@@ -10,7 +10,7 @@ import { RuleDescription, SeverityLevel, COMMON_TAGS } from '@salesforce/code-an
1010 */
1111export const APEXGURU_RULES : RuleDescription [ ] = [
1212 // =================================================================================================================
13- // PERFORMANCE RULES - HIGH SEVERITY
13+ // PERFORMANCE RULES - HIGH SEVERITY (CRITICAL - RECOMMENDED)
1414 // =================================================================================================================
1515
1616 {
@@ -30,7 +30,7 @@ export const APEXGURU_RULES: RuleDescription[] = [
3030 } ,
3131
3232 // =================================================================================================================
33- // PERFORMANCE RULES - MODERATE SEVERITY
33+ // PERFORMANCE RULES - MODERATE SEVERITY (CRITICAL - RECOMMENDED)
3434 // =================================================================================================================
3535
3636 {
@@ -50,97 +50,105 @@ export const APEXGURU_RULES: RuleDescription[] = [
5050 } ,
5151
5252 {
53- name : 'Soql Aggregation ' ,
53+ name : 'SchemaGetGlobalDescribeNotEfficient ' ,
5454 severityLevel : SeverityLevel . Moderate ,
5555 tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
56+ description : 'Using Schema.getGlobalDescribe() causes unnecessary overhead and decreases performance' ,
57+ resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_schema_getglobaldescribe_not_efficient.htm&type=5' ]
58+ } ,
59+
60+ // =================================================================================================================
61+ // PERFORMANCE RULES - MODERATE SEVERITY (PERFORMANCE ONLY - NOT RECOMMENDED)
62+ // =================================================================================================================
63+
64+ {
65+ name : 'Soql Aggregation' ,
66+ severityLevel : SeverityLevel . Moderate ,
67+ tags : [ COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
5668 description : 'Manual aggregation in Apex instead of using SOQL aggregate functions causes performance issues' ,
5769 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_aggregating_in_apex.htm&type=5' ]
5870 } ,
5971
6072 {
6173 name : 'SoqlWithApexFilter' ,
6274 severityLevel : SeverityLevel . Moderate ,
63- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
75+ tags : [ COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
6476 description : 'Filtering records in Apex instead of using SOQL WHERE clause causes performance issues' ,
6577 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_soql_with_apex_filter.htm&type=5' ]
6678 } ,
6779
6880 {
6981 name : 'CopyingListOrSetElementsUsingAForLoop' ,
7082 severityLevel : SeverityLevel . Moderate ,
71- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
83+ tags : [ COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
7284 description : 'Copying list or set elements using a for loop is inefficient - use addAll() instead' ,
7385 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_copying_elements_with_for_loop.htm&type=5' ]
7486 } ,
7587
7688 {
7789 name : 'Redundant Soql' ,
7890 severityLevel : SeverityLevel . Moderate ,
79- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
91+ tags : [ COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
8092 description : 'Multiple identical SOQL queries cause unnecessary database round trips' ,
8193 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_redundant_soql.htm&type=5' ]
8294 } ,
8395
84- {
85- name : 'SchemaGetGlobalDescribeNotEfficient' ,
86- severityLevel : SeverityLevel . Moderate ,
87- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
88- description : 'Using Schema.getGlobalDescribe() causes unnecessary overhead and decreases performance' ,
89- resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_schema_getglobaldescribe_not_efficient.htm&type=5' ]
90- } ,
91-
9296 {
9397 name : 'SoqlWithNegativeExpressions' ,
9498 severityLevel : SeverityLevel . Moderate ,
95- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
99+ tags : [ COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
96100 description : 'SOQL queries using negative expressions (NOT IN, !=) don\'t use indexes and cause full table scans' ,
97101 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_soql_with_negative_expressions.htm&type=5' ]
98102 } ,
99103
100104 {
101105 name : 'SObjectMapInAForLoop' ,
102106 severityLevel : SeverityLevel . Moderate ,
103- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
107+ tags : [ COMMON_TAGS . CATEGORIES . PERFORMANCE , COMMON_TAGS . LANGUAGES . APEX ] ,
104108 description : 'Building Map<Id, SObject> using .put() in a for loop is inefficient - use map constructor or putAll()' ,
105109 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_sobject_map_in_for_loop.htm&type=5' ]
106110 } ,
107111
108112 // =================================================================================================================
109- // BEST PRACTICES - LOW SEVERITY
113+ // BEST PRACTICES - LOW SEVERITY (RECOMMENDED)
110114 // =================================================================================================================
111115
112116 {
113- name : 'SortingInApex ' ,
117+ name : 'UsingTheTestMethodKeyword ' ,
114118 severityLevel : SeverityLevel . Low ,
115119 tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . BEST_PRACTICES , COMMON_TAGS . LANGUAGES . APEX ] ,
120+ description : 'The testMethod keyword is deprecated - use @isTest annotation instead' ,
121+ resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_test_case_antipattern_using_testmethod.htm&type=5' ]
122+ } ,
123+
124+ // =================================================================================================================
125+ // BEST PRACTICES - LOW SEVERITY (NOT RECOMMENDED)
126+ // =================================================================================================================
127+
128+ {
129+ name : 'SortingInApex' ,
130+ severityLevel : SeverityLevel . Low ,
131+ tags : [ COMMON_TAGS . CATEGORIES . BEST_PRACTICES , COMMON_TAGS . LANGUAGES . APEX ] ,
116132 description : 'Sorting records in Apex wastes CPU time and can exceed governor limits - use ORDER BY in SOQL' ,
117133 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_sorting_in_apex.htm&type=5' ]
118134 } ,
119135
120136 {
121137 name : 'BusyLoopDelay' ,
122138 severityLevel : SeverityLevel . Low ,
123- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . BEST_PRACTICES , COMMON_TAGS . LANGUAGES . APEX ] ,
139+ tags : [ COMMON_TAGS . CATEGORIES . BEST_PRACTICES , COMMON_TAGS . LANGUAGES . APEX ] ,
124140 description : 'Using empty loops to delay execution wastes CPU time - use System.enqueueJob with delay parameter' ,
125141 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_busy_loop_delay.htm&type=5' ]
126142 } ,
127143
128144 {
129145 name : 'SoqlWithUnusedFields' ,
130146 severityLevel : SeverityLevel . Low ,
131- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . BEST_PRACTICES , COMMON_TAGS . LANGUAGES . APEX ] ,
147+ tags : [ COMMON_TAGS . CATEGORIES . BEST_PRACTICES , COMMON_TAGS . LANGUAGES . APEX ] ,
132148 description : 'SOQL query selecting unused fields increases resource consumption unnecessarily' ,
133149 resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_soql_with_unused_fields.htm&type=5' ]
134150 } ,
135151
136- {
137- name : 'UsingTheTestMethodKeyword' ,
138- severityLevel : SeverityLevel . Low ,
139- tags : [ COMMON_TAGS . RECOMMENDED , COMMON_TAGS . CATEGORIES . BEST_PRACTICES , COMMON_TAGS . LANGUAGES . APEX ] ,
140- description : 'The testMethod keyword is deprecated - use @isTest annotation instead' ,
141- resourceUrls : [ 'https://help.salesforce.com/s/articleView?id=xcloud.apexguru_test_case_antipattern_using_testmethod.htm&type=5' ]
142- } ,
143-
144152 // =================================================================================================================
145153 // FALLBACK RULE
146154 // =================================================================================================================
0 commit comments