@@ -17,26 +17,73 @@ export enum ViolationContextScope {
1717 */
1818export const A4D_SUPPORTED_RULES : Map < string , ViolationContextScope > = new Map ( [
1919 // =======================================================================
20- // ==== Rules from rule selector: 'pmd:Recommended: Documentation:Apex'
20+ // ==== Rules from rule selector: 'pmd:Documentation:Apex'
2121 // =======================================================================
2222 [ 'ApexDoc' , ViolationContextScope . MethodScope ] ,
2323
2424
2525 // =======================================================================
26- // ==== Rules from rule selector: 'pmd:Recommended:ErrorProne:Apex'
26+ // ==== Rules from rule selector: 'pmd:BestPractices:Apex'
27+ // =======================================================================
28+ [ 'ApexAssertionsShouldIncludeMessage' , ViolationContextScope . ViolationScope ] ,
29+ [ 'ApexUnitTestMethodShouldHaveIsTestAnnotation' , ViolationContextScope . ClassScope ] ,
30+ [ 'ApexUnitTestShouldNotUseSeeAllDataTrue' , ViolationContextScope . ClassScope ] , // Range really should just be the violation but see ApexUnitTestShouldNotUseSeeAllDataTrue
31+ [ 'UnusedLocalVariable' , ViolationContextScope . ViolationScope ] ,
32+ // NOTE: We have decided that the following `BestPractices` rules either do not get any value from A4D Quick Fix
33+ // suggestions or that the model currently gives back poor suggestions:
34+ // ApexUnitTestClassShouldHaveAsserts, ApexUnitTestClassShouldHaveRunAs, AvoidGlobalModifier, AvoidLogicInTrigger,
35+ // DebugsShouldUseLoggingLevel, QueueableWithoutFinalizer
36+
37+ // =======================================================================
38+ // ==== Rules from rule selector: 'pmd:CodeStyle:Apex'
39+ // =======================================================================
40+ [ 'ClassNamingConventions' , ViolationContextScope . ViolationScope ] ,
41+ [ 'FieldDeclarationsShouldBeAtStart' , ViolationContextScope . ClassScope ] ,
42+ [ 'FieldNamingConventions' , ViolationContextScope . ViolationScope ] ,
43+ [ 'ForLoopsMustUseBraces' , ViolationContextScope . ViolationScope ] ,
44+ [ 'FormalParameterNamingConventions' , ViolationContextScope . ViolationScope ] ,
45+ [ 'LocalVariableNamingConventions' , ViolationContextScope . ViolationScope ] ,
46+ [ 'MethodNamingConventions' , ViolationContextScope . ViolationScope ] ,
47+ [ 'OneDeclarationPerLine' , ViolationContextScope . ViolationScope ] ,
48+ [ 'PropertyNamingConventions' , ViolationContextScope . ViolationScope ] ,
49+ // NOTE: We have decided that the following `CodeStyle` rules either do not get any value from A4D Quick Fix
50+ // suggestions or that the model currently gives back poor suggestions:
51+ // IfElseStmtsMustUseBraces, IfStmtsMustUseBraces, WhileLoopsMustUseBraces
52+
53+
54+ // =======================================================================
55+ // ==== Rules from rule selector: 'pmd:Design:Apex'
56+ // =======================================================================
57+ [ 'AvoidDeeplyNestedIfStmts' , ViolationContextScope . MethodScope ] ,
58+ // NOTE: We have decided that the following `Design` rules either do not get any value from A4D Quick Fix
59+ // suggestions or that the model currently gives back poor suggestions:
60+ // CognitiveComplexity, CyclomaticComplexity, ExcessiveClassLength, ExcessiveParameterList, ExcessivePublicCount,
61+ // NcssConstructorCount, NcssMethodCount, NcssTypeCount, StdCyclomaticComplexity, TooManyFields, UnusedMethod
62+
63+
64+ // =======================================================================
65+ // ==== Rules from rule selector: 'pmd:ErrorProne:Apex'
2766 // =======================================================================
2867 [ 'AvoidDirectAccessTriggerMap' , ViolationContextScope . MethodScope ] ,
2968 [ 'InaccessibleAuraEnabledGetter' , ViolationContextScope . MethodScope ] ,
69+ [ 'MethodWithSameNameAsEnclosingClass' , ViolationContextScope . MethodScope ] ,
3070 [ 'OverrideBothEqualsAndHashcode' , ViolationContextScope . ViolationScope ] ,
3171 [ 'TestMethodsMustBeInTestClasses' , ViolationContextScope . ClassScope ] ,
3272 // NOTE: We have decided that the following `ErrorProne` rules either do not get any value from A4D Quick Fix
3373 // suggestions or that the model currently gives back poor suggestions:
3474 // AvoidHardcodingId, AvoidNonExistentAnnotations, EmptyCatchBlock, EmptyIfStmt, EmptyStatementBlock,
35- // EmptyTryOrFinallyBlock, EmptyWhileStmt, MethodWithSameNameAsEnclosingClass
75+ // EmptyTryOrFinallyBlock, EmptyWhileStmt
76+ // NOTE: New rules like AvoidStatefulDatabaseResult and TypeShadowsBuiltInNamespace have yet to be evaluated.
3677
3778
3879 // =======================================================================
39- // ==== Rules from rule selector: 'pmd:Recommended:Security:Apex'
80+ // ==== Rules from rule selector: 'pmd:Performance:Apex'
81+ // =======================================================================
82+ // All the performance rules have yet to be evaluated.
83+
84+
85+ // =======================================================================
86+ // ==== Rules from rule selector: 'pmd:Security:Apex'
4087 // =======================================================================
4188 [ 'ApexBadCrypto' , ViolationContextScope . MethodScope ] ,
4289 [ 'ApexCRUDViolation' , ViolationContextScope . MethodScope ] ,
@@ -51,7 +98,5 @@ export const A4D_SUPPORTED_RULES: Map<string, ViolationContextScope> = new Map([
5198 // NOTE: We have decided that the following `Security` rule(s) either do not get any value from A4D Quick Fix
5299 // suggestions or that the model currently gives back poor suggestions:
53100 // ApexOpenRedirect
54-
55-
56- // NOTE: We still need to evaluate other rule categories, so more will come in future releases.
101+ // NOTE: AppExchange rules have not been evaluated.
57102] ) ;
0 commit comments