Install and Update Salesforce Code Analyzer

Install and Update Salesforce Code Analyzer

Install Salesforce Code Analyzer v3.x

NOTE: Complete the prerequisites before you install Salesforce Code Analyzer.

Install Salesforce Code Analyzer (Code Analyzer) with this simple line of code.

$ sf plugins install @salesforce/sfdx-scanner

By default, latest tag is installed: 3.21.0.

To check that Code Analyzer is installed, run this command.

$ sf plugins
@salesforce/sfdx-scanner 3.21.0

To install a specific Code Analyzer version, run this command.

$ sf plugins install @salesforce/sfdx-scanner@3.21.0
Installing plugin @salesforce/sfdx-scanner... 
installed v3.21.0

To display Code Analyzer usage and help, run this command.

$ sf scanner --help
Scan code to detect code quality issues and security vulnerabilities.

USAGE
  $ sf scanner COMMAND

TOPICS
  scanner rule  view or add rules to scan code
  scanner run   scan a codebase with a selection of rules

COMMANDS
  scanner run  scan a codebase with a selection of rules

Update Code Analyzer v3.x

To update Code Analyzer, run this command.

$ sf plugins update
@salesforce/cli: Updating plugins... done

Uninstall Code Analyzer v3.x

To uninstall Code Analyzer, run this command.

sf plugins uninstall @salesforce/sfdx-scanner

See Also

Salesforce CLI Setup Guide: Update Salesforce CLI

Salesforce CLI Setup Guide: Troubleshoot Salesforce CLI

Feedback or Bugs | Edit this Article