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
ai
    Impact
      Clean code attribute
        1. InvocableMethod annotations should include descriptive label and description

           Code Smell

        InvocableMethod annotations should include descriptive label and description

        intentionality - complete
        maintainability
        Code Smell
        • salesforce
        • ai

        This is an issue when an @InvocableMethod annotation lacks a label and description, or when these attributes contain empty values.

        Why is this an issue?

        How can I fix it?

        More Info

        Einstein Copilot is a conversational AI assistant that helps Salesforce users execute commands using natural language. When developers create custom actions using Apex methods annotated with @InvocableMethod, Copilot relies on the label and description attributes to understand what each method does.

        Without clear and descriptive labels and descriptions, Einstein Copilot cannot effectively match user conversation intents with the appropriate actions. This leads to poor user experience where:

        • Users' natural language requests may not trigger the intended custom actions
        • Copilot may suggest irrelevant or incorrect actions
        • The AI assistant becomes less helpful and intuitive to use

        The label should provide a concise, human-readable name for the action, while the description should explain what the method accomplishes. These descriptions are crucial for Copilot’s intent matching algorithm to work effectively.

        What is the potential impact?

        Poor intent matching in Einstein Copilot leads to frustrated users who cannot effectively interact with custom actions through natural language. This reduces the value of the conversational AI assistant and may result in users avoiding the feature entirely.

          Available In:
        • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use