-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathActionCallsInLoop.ts
More file actions
25 lines (25 loc) · 1.1 KB
/
ActionCallsInLoop.ts
File metadata and controls
25 lines (25 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { FlowType, IRuleDefinition } from "../internals/internals";
import { LoopRuleCommon } from "../models/LoopRuleCommon";
export class ActionCallsInLoop extends LoopRuleCommon implements IRuleDefinition {
constructor() {
super(
{
ruleId: "action-call-in-loop",
category: "suggestion",
description: "Repeatedly invoking Apex actions inside a loop can exhaust governor limits and lead to performance issues. Where possible, bulkify your logic by moving the action call outside the loop and passing a collection variable instead.",
summary: "Action calls inside loop risk governor limits",
docRefs: [
{
label: "Action Call In A Loop",
path: "https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm",
},
],
label: "Action Call In A Loop",
name: "ActionCallsInLoop",
supportedTypes: FlowType.backEndTypes,
}, { severity: "warning" });
}
protected getStatementTypes(): string[] {
return ["actionCalls", "apexPluginCalls"];
}
}