Duplicated code impacts the quality of your Salesforce org. Every block of duplicated code detected across Apex Classes and Apex Triggers generates an issue in instance scans.
The severity of the issue depends on the total number of code lines which are repeated in the Org (size of repeated block x number of lines in the block x number of repetitions).
The minimum token length which should be reported as a duplicate is set to 100
.
You can find the code duplication issues on the Duplicated Code view.
Best Practice | Configuration Element Type | Issue Severity | Impact Area |
---|---|---|---|
Code Duplication | Apex Class | HIGH (if total number of duplicated lines is over 1000) | Manageability |
Code Duplication | Apex Class | MEDIUM (if total number of duplicated lines is between 100 and 1000) | Manageability |
Code Duplication | Apex Class | LOW (if total number of duplicated lines is between 10 and 100) | Manageability |
Code Duplication | Apex Trigger | HIGH (if total number of duplicated lines is over 1000) | Manageability |
Code Duplication | Apex Trigger | MEDIUM (if total number of duplicated lines is between 100 and 1000) | Manageability |
Code Duplication | Apex Trigger | LOW (if total number of duplicated lines is between 10 and 100) | Manageability |