-
Notifications
You must be signed in to change notification settings - Fork 11
How to setup the SFDX Scanner CLI Plugin for Static Code Analysis
-
Install the Java Development Kit (JDK) version 8 or higher
-
Install the Salesforce CLI
-
Install the sfdx scanner plugin for the Salesforce CLI by opening up a terminal window and running the following command:
sfdx plugins:install @salesforce/sfdx-scanner-
Create a Salesforce Project in VSCode
-
Open the Terminal in VSCode and run the following command to scan your entire codebase for all static code issues (make sure to replace pathToFile.csv with the actual path for your file):
sfdx scanner:run --target "**/default/**" --format "csv" --outfile "pathToFile.csv" -
The above command will output a csv that shows you all of the issues with the code in your org within a few seconds (unless you have a mega code-base. It may take a few minutes then).
-
For more information on the wealth of configuration options you have with this cli plugin, please check out the supplementary info links.
Supplementary Info