Run analysis locally using SFDX
Last updated
Was this helpful?
Last updated
Was this helpful?
This article will guide you through how to run the code analysis manually using our CodeScan Plugin and Salesforce CLI.
To run the code analysis manually using our CodeScan Plugin and Salesforce CLI, first make sure you have:
Salesforce CLI installed. Click to download the Salesforce CLI and its dependencies.
Java 17
NodeJS 18
To install the CodeScan SFDX plugin, follow these steps:
Use sfdx plugins:install sfdx-codescan-plugin
.
You'll be prompted that Salesforce does not sign this plugin; type Y to continue.
Check the installation using sfdx plugins.
You're ready to run a scan once the installation is completed. To run this scan, follow these steps:
Open Bash CLI like Git Bash, etc.
Now, go to the folder with the project sources you want to run a scan on and enter the command as shown below:
Add --server <Server Name>
Replace Project key
Replace Organization key
Replace Token
Replace your server name (if applicable).
To view a list of parameters and flags which you can use, run the following command: sfdx help codescan:run
This will start the analysis directly on the .
To learn how to generate a Security Token, click .
If you want to run the analysis in , , or , then make the following changes in the command: