Importing Salesforce CLI Code Coverage

CodeScan can take JSON coverage files generated by the Salesforce CLI and apply the coverage in your analysis.

If you are using the Salesforce CLI to run the analysis, see our guide here.

If you have a Git project created in CodeScan Cloud:

  • Open your project and navigate to Project Settings > General Settings at the top right of the screen

  • Click the CodeScan tab on the right

  • Scroll down to the Testing section

  • Add the JSON code coverage file name and re-run the analysis

When you are generating your coverage file with the Salesforce CLI, the JSON file name will be generated dynamically. Rename this file after it is created to make sure it can be referenced consistently.

After the analysis completes you will be able to view the coverage percentage on your project overview.

Last updated