Static Code Analysis Overview

Updated 2 months ago by Copado Solutions

Static code analysis (SCA) allows you to detect code inefficiencies, errors and bad habits before they grow into expensive problems. You can use code analysis to automatically monitor developers’ code and enforce implementation best practices. Once you have the results, you can review them and prioritize rules depending on your business needs as well as decide whether code can be moved to an upper environment or not.

In Copado, you can use this powerful quality gate throughout the release management process from different records such as Org Credential, User Story or Scheduled Job.

Copado currently uses two tools to perform code review, PMD, which is an open source static code analysis tool, and CodeScan which is the tool used to review code for Salesforce and has been added on v12.1. You can run static code analysis on all Apex code across an org as well as on specific Apex code added to a particular user story. When working with PMD, the static code analysis results of user stories included in a promotion will be displayed on that promotion.

For more information about static code analysis, check out the articles below:

Create Static Code Analysis Settings with Default RuleSet

Run Static Code Analysis

Review Static Code Analysis Results

How did we do?