Create Static Code Analysis Settings with Default RuleSet
To create static code analysis settings with default RuleSet, follow the steps below:
- Navigate to the Static Code Analysis Settings page.
- Click on New.
- Fill in the New Static Code Analysis Settings Name field and click on Save.
- Open Static Code Analysis Settings and click on Generate Default RuleSet.
RuleSet can be customized (Add, Edit and Delete). Each rule has a priority within a 1 to 5 interval, and it can be defined according to the relevance of the violated rule.
- A rule with priority 1 is considered as the most important rule and a rule with priority 5 as the least
- The scoring is calculated by subtracting the selected priority from 6 (6 - selected priority).
- A high number of violated rules will throw a high static code analysis result (the higher the worst).
There is a total of 34 rules specially tailored to enforce Apex code best practices.
Assign Static Code Analysis RuleSet to a Deployment Flow
Navigate to the Deployment Flow page, open a deployment flow and assign Static Code Analysis Settings to it.