SonarSource Rules
  • Products

    In-IDE

    Code Quality and Security in your IDE with SonarQube Ide

    IDE extension that lets you fix coding issues before they exist!

    Discover SonarQube for IDE

    SaaS

    Code Quality and Security in the cloud with SonarQube Cloud

    Setup is effortless and analysis is automatic for most languages

    Discover SonarQube Cloud

    Self-Hosted

    Code Quality and Security Self-Hosted with SonarQube Server

    Fast, accurate analysis; enterprise scalability

    Discover SonarQube Server
  • SecretsSecrets
  • ABAPABAP
  • AnsibleAnsible
  • ApexApex
  • AzureResourceManagerAzureResourceManager
  • CC
  • C#C#
  • C++C++
  • CloudFormationCloudFormation
  • COBOLCOBOL
  • CSSCSS
  • DartDart
  • DockerDocker
  • FlexFlex
  • GitHub ActionsGitHub Actions
  • GoGo
  • HTMLHTML
  • JavaJava
  • JavaScriptJavaScript
  • JSONJSON
  • JCLJCL
  • KotlinKotlin
  • KubernetesKubernetes
  • Objective CObjective C
  • PHPPHP
  • PL/IPL/I
  • PL/SQLPL/SQL
  • PythonPython
  • RPGRPG
  • RubyRuby
  • RustRust
  • ScalaScala
  • ShellShell
  • SwiftSwift
  • TerraformTerraform
  • TextText
  • TypeScriptTypeScript
  • T-SQLT-SQL
  • VB.NETVB.NET
  • VB6VB6
  • XMLXML
  • YAMLYAML
Apex

Apex static code analysis

Unique rules to find Bugs, Vulnerabilities, Security Hotspots, and Code Smells in your APEX code

  • All rules 97
  • Vulnerability2
  • Bug26
  • Security Hotspot3
  • Code Smell66
Filtered: 1 rule found
deprecated
    Impact
      Clean code attribute
        1. "getRoleAndSubordinates()" should be replaced with "getRoleAndSubordinatesInternal()"

           Code Smell

        "getRoleAndSubordinates()" should be replaced with "getRoleAndSubordinatesInternal()"

        consistency - conventional
        maintainability
        Code Smell
        • deprecated
        • salesforce
        • apex

        This rule raises an issue when code uses the deprecated UserInfo.getRoleAndSubordinates() method, which will be removed in future Salesforce releases.

        Why is this an issue?

        How can I fix it?

        More Info

        Salesforce is phasing out the getRoleAndSubordinates() method as part of the Winter '26 release. This method will stop working in Spring '26, potentially breaking your applications.

        The getRoleAndSubordinates() method has been replaced by getRoleAndSubordinatesInternal() to provide better internal handling of role-based sharing groups. Both methods return the same data - a set of user IDs that includes the current user and all users in subordinate roles.

        Using the deprecated method creates technical debt and puts your code at risk of runtime failures when Salesforce removes support for the old method.

        What is the potential impact?

        Applications using the deprecated method will experience runtime errors and broken functionality once Salesforce removes support in Spring '26. This can affect:

        • SOQL queries that filter records based on role hierarchy
        • Security and sharing logic that depends on role-based access
        • Reports and dashboards that use role-based data filtering
        • Any business processes that rely on hierarchical data access
          Available In:
        • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories

        © 2025 SonarSource Sàrl. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use