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
lightning
    Impact
      Clean code attribute
        1. Methods with "@AuraEnabled" should be public or global

           Bug

        Methods with "@AuraEnabled" should be public or global

        intentionality - logical
        reliability
        Bug
        • salesforce
        • lightning

        This rule raises an issue when a method is annotated with @AuraEnabled but has private or protected visibility.

        Why is this an issue?

        How can I fix it?

        More Info

        Lightning Web Components can only import and call Apex methods that are accessible from outside the class. The @AuraEnabled annotation marks a method as available for Lightning components, but the method must also have the proper visibility to be actually accessible.

        When a method is marked as private or protected, it cannot be imported by Lightning Web Components, even if it has the @AuraEnabled annotation. This creates a mismatch between the developer’s intent (making the method available to Lightning components) and the actual accessibility of the method.

        The Salesforce platform requires @AuraEnabled methods to be either public or global to ensure they can be properly imported and called from Lightning Web Components using the ES6 import syntax.

        What is the potential impact?

        The method will not be accessible from Lightning Web Components, causing import errors or runtime failures when the component tries to call the method. This can break the functionality of Lightning components that depend on these Apex methods.

          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