This documentation guides you through how to run the code manually using our CodeScan Plugin and Salesforce CLI.
To run the code manually using our CodeScan Plugin and Salesforce CLI, first make sure you have Salesforce CLI installed.
- Click here to download the Salesforce CLI and it’s dependencies.
To install the CodeScan SFDX plugin
- Use sfdx plugins:install sfdx-codescan-plugin.
- You'll be prompted that this plugin is not signed by Salesforce, type y to continue.
- Check the installation using sfdx plugins.
Once the installation is successful, you are all set to run a scan.
To run this scan,
- Open Bash CLI like Git Bash,etc.,
- Now, Go to the file or the repository you want to run a scan on and Enter the command as shown below:
sfdx codescan:run --token <token> --projectkey <project key>> --organization <organization key>
If you are looking for where to find your project key and the organization key, click on the respective links below:
Project keys differ from project to project as both the Organization key and Project key are unique.
If you want to run the analysis locally instead of cloud, add --server <Server Name> to the above command.
Here,Replace the ones highlighted with your respective
- Project key
- Organization key
- Token
- Your server name (if applicable).
This will start the analysis directly on codescan cloud
To know how to generate a token, click here as the link has all the instructions required
To view a list of parameters and flags which you can use, run the following command.
sfdx help codescan:run