Create Static Code Analysis Settings with Default RuleSet
Go 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 the Static Code Analysis Settings, click on Generate Default RuleSet.
RuleSet can be customised (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.
- Priority 1 will be considered as a highly important rule, and priority 5 as the lowest.
- The scoring is calculated by the subtraction of (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 Deployment Flow
Go to the Deployment Flow page, open a Deployment Flow and assign it the Static Code Analysis Setting.