Run Static Code Analysis

Updated 1 day ago by Copado Solutions

Static code analysis (SCA) is a useful practice that allows you to review code and detect errors throughout the deployment lifecycle.

There are many places where you can execute code analysis with Coapdo, which we will describe in more detail below. But prior to running a static code analysis, you will need to define code analysis settings and assign them to a deployment flow. To learn more about this, check out the article Create Static Code Analysis Settings with Default RuleSet.

Org Credential

You can request status code analysis for all classes in a Salesforce org to run from an Org Credential record where the org credential is included in a deployment flow with SCA settings assigned. To do this, navigate to the Org Credential record and click on Run Static Code Analysis.

User Story

In a user story with an environment inside the deployment flow that has SCA settings assigned, you can request static code analysis for Apex classes related to it. To do this, navigate to the User Story record and click on the drop-down menu in the top right corner. Then click on Run Static Code Analysis.

Scheduled Job

When executing a schedule job, you can select the Org Static Code Analysisl or the User Story Static Code Analysis webhooks to run static code on an existing org credential or user story.  Once the job is executed. the results will be listed in the Org Credentials or User Story records.


How did we do?