Salesforce Code Analyzer is a unified tool to help Salesforce developers analyze their source code for security vulnerabilities, performance issues, best practices, and more. Code Analyzer analyzes multiple languages including Apex, JavaScript, HTML, CSS, and Salesforce metadata such as Flows. It relies on a consistent command-line interface and produces a results file of rule violations. Use the results to review and improve your code.
If you're listing a managed package on AppExchange, it must pass security review. You're also required to upload your Salesforce Code Analyzer scan reports. Attach your Code Analyzer reports to your submission in the AppExchange Security Review Wizard. For more info, read Scan Your Code with Salesforce Code Analyzer and AppExchange Security Review.
Integrate Code Analyzer into your Continuous Integration/Continuous Development (CI/CD) process to enforce rules that you define and to produce high-quality code. Salesforce provides an official Github Action to assist with this task.
Read the Salesforce Code Analyzer documentation to learn:
- How to install Code Analyzer.
- What's included in the Code Analyzer command reference.
- What rules are included from engines such as PMD and ESLint.
- How to write and manage custom rules.
- How to set up your CI/CD process with Code Analyzer.
- How to review code violations with the Code Analyzer VS Code Extension.