Skip to content

Commit d89abf4

Browse files
NEW: @W-19037698@: Add in support for 6 more rules to the A4D Quick Fix feature (#275)
1 parent 8185f80 commit d89abf4

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

src/lib/agentforce/supported-rules.ts

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ export const A4D_SUPPORTED_RULES: Map<string, ViolationContextScope> = new Map([
6565
// ==== Rules from rule selector: 'pmd:ErrorProne:Apex'
6666
// =======================================================================
6767
['AvoidDirectAccessTriggerMap', ViolationContextScope.MethodScope],
68+
['AvoidStatefulDatabaseResult', ViolationContextScope.ClassScope],
6869
['InaccessibleAuraEnabledGetter', ViolationContextScope.MethodScope],
6970
['MethodWithSameNameAsEnclosingClass', ViolationContextScope.MethodScope],
7071
['OverrideBothEqualsAndHashcode', ViolationContextScope.ViolationScope],
7172
['TestMethodsMustBeInTestClasses', ViolationContextScope.ClassScope],
73+
['TypeShadowsBuiltInNamespace', ViolationContextScope.ViolationScope],
7274
// NOTE: We have decided that the following `ErrorProne` rules either do not get any value from A4D Quick Fix
7375
// suggestions or that the model currently gives back poor suggestions:
7476
// AvoidHardcodingId, AvoidNonExistentAnnotations, EmptyCatchBlock, EmptyIfStmt, EmptyStatementBlock,
7577
// EmptyTryOrFinallyBlock, EmptyWhileStmt
76-
// NOTE: New rules like AvoidStatefulDatabaseResult and TypeShadowsBuiltInNamespace have yet to be evaluated.
7778

7879

7980
// =======================================================================
@@ -83,7 +84,7 @@ export const A4D_SUPPORTED_RULES: Map<string, ViolationContextScope> = new Map([
8384

8485

8586
// =======================================================================
86-
// ==== Rules from rule selector: 'pmd:Security:Apex'
87+
// ==== Rules from rule selector: 'pmd:Security:Apex' (except AppExchange rules)
8788
// =======================================================================
8889
['ApexBadCrypto', ViolationContextScope.MethodScope],
8990
['ApexCRUDViolation', ViolationContextScope.MethodScope],
@@ -94,9 +95,30 @@ export const A4D_SUPPORTED_RULES: Map<string, ViolationContextScope> = new Map([
9495
['ApexSOQLInjection', ViolationContextScope.MethodScope],
9596
['ApexSuggestUsingNamedCred', ViolationContextScope.MethodScope],
9697
['ApexXSSFromEscapeFalse', ViolationContextScope.MethodScope],
97-
['ApexXSSFromURLParam', ViolationContextScope.ViolationScope]
98+
['ApexXSSFromURLParam', ViolationContextScope.ViolationScope],
9899
// NOTE: We have decided that the following `Security` rule(s) either do not get any value from A4D Quick Fix
99100
// suggestions or that the model currently gives back poor suggestions:
100101
// ApexOpenRedirect
101-
// NOTE: AppExchange rules have not been evaluated.
102+
103+
// =======================================================================
104+
// ==== Rules from rule selector: 'pmd:Performance:Apex'
105+
// =======================================================================
106+
['EagerlyLoadedDescribeSObjectResult', ViolationContextScope.ViolationScope],
107+
['OperationWithHighCostInLoop', ViolationContextScope.MethodScope],
108+
['OperationWithLimitsInLoop', ViolationContextScope.MethodScope],
109+
// NOTE: We have decided that the following `Performance` rule(s) either do not get any value from A4D Quick Fix
110+
// suggestions or that the model currently gives back poor suggestions:
111+
// AvoidDebugStatements, AvoidNonRestrictiveQueries
112+
113+
// =======================================================================
114+
// ==== Rules from rule selector: 'pmd:AppExchange:Apex'
115+
// =======================================================================
116+
['AvoidGlobalInstallUninstallHandlers', ViolationContextScope.ClassScope]
117+
// NOTE: We have decided that the following `AppExchange` rule(s) either do not get any value from A4D Quick Fix
118+
// suggestions or that the model currently gives back poor suggestions:
119+
// AvoidChangeProtectionUnprotected, AvoidGetInstanceWithTaint, AvoidHardcodedCredentialsInFieldDecls,
120+
// AvoidHardcodedCredentialsInHttpHeader, AvoidHardcodedCredentialsInSetPassword,
121+
// AvoidHardcodedCredentialsInVarAssign, AvoidHardcodedCredentialsInVarDecls, AvoidInvalidCrudContentDistribution,
122+
// AvoidSecurityEnforcedOldApiVersion, AvoidUnauthorizedApiSessionIdInApex, AvoidUnauthorizedGetSessionIdInApex,
123+
// AvoidUnsafePasswordManagementUse
102124
]);

0 commit comments

Comments
 (0)