@flow-scanner/lightning-flow-scanner-core 6.15.2 β†’ 6.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,9 +32,9 @@
32
32
  ## Table of contents
33
33
 
34
34
  - **[Default Rules](#default-rules)**
35
- - [problems](#problems)
36
- - [suggestions](#suggestions)
37
- - [layout](#layout)
35
+ - [Problems](#problems)
36
+ - [Suggestions](#suggestions)
37
+ - [Layout](#layout)
38
38
  - **[Configuration](#configuration)**
39
39
  - [Configure Rules](#configure-rules)
40
40
  - [Define Exceptions](#define-exceptions)
@@ -53,207 +53,185 @@
53
53
  <p>πŸ“Œ<strong>Tip:</strong> To link directly to a specific rule, use the full GitHub anchor link format. Example:</p>
54
54
  <p><em><a href="https://flow-scanner.github.io/lightning-flow-scanner/#unsafe-running-context">https://flow-scanner.github.io/lightning-flow-scanner/#unsafe-running-context</a></em></p>
55
55
 
56
- > Want to code a new rule? β†’ See [How to Write a Rule](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/write-a-rule.md)
57
-
58
- <!-- START GENERATED_RULES -->
59
- ### Problems
60
-
61
- ### DML Statement In A Loop
62
- Executing DML operations (insert, update, delete) inside a loop is a high-risk anti-pattern that frequently causes governor limit exceptions. All database operations should be collected and executed once, outside the loop.
63
-
64
- **Rule ID:** `dml-in-loop`
65
- **Class Name:** _[DMLStatementInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DMLStatementInLoop.ts)_
66
- **Severity:** πŸ”΄ *Error*
67
-
68
- ### Hardcoded Id
69
- Avoid hard-coding record IDs, as they are unique to a specific org and will not work in other environments. Instead, store IDs in variablesβ€”such as merge-field URL parameters or a **Get Records** elementβ€”to make the Flow portable, maintainable, and flexible.
70
-
71
- **Rule ID:** `hardcoded-id`
72
- **Class Name:** _[HardcodedId](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedId.ts)_
73
- **Severity:** πŸ”΄ *Error*
74
-
75
- ### Hardcoded Url
76
- Avoid hard-coding URLs, as they may change between environments or over time. Instead, store URLs in variables or custom settings to make the Flow adaptable, maintainable, and environment-independent.
77
-
78
- **Rule ID:** `hardcoded-url`
79
- **Class Name:** _[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_
80
- **Severity:** πŸ”΄ *Error*
81
-
82
- ### Process Builder
83
- Process Builder is retired. Continuing to use it increases maintenance overhead and risks future compatibility issues. Migrating automation to Flow reduces risk and improves maintainability.
84
-
85
- **Rule ID:** `process-builder-usage`
86
- **Class Name:** _[ProcessBuilder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ProcessBuilder.ts)_
87
- **Severity:** πŸ”΄ *Error*
88
-
89
- ### SOQL Query In A Loop
90
- Running SOQL queries inside a loop can rapidly exceed query limits and severely degrade performance. Queries should be executed once, with results reused throughout the loop.
91
-
92
- **Rule ID:** `soql-in-loop`
93
- **Class Name:** _[SOQLQueryInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SOQLQueryInLoop.ts)_
94
- **Severity:** πŸ”΄ *Error*
95
-
96
- ### Unsafe Running Context
97
- Flows configured to run in System Mode without Sharing grant access to all data, bypassing user permissions. Avoid this setting to prevent security risks and protect sensitive data.
98
-
99
- **Rule ID:** `unsafe-running-context`
100
- **Class Name:** _[UnsafeRunningContext](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnsafeRunningContext.ts)_
101
- **Severity:** πŸ”΄ *Error*
102
-
103
- ### Duplicate DML Operation
104
- When a Flow performs database operations across multiple screens, users navigating backward can cause the same actions to run multiple times. To prevent unintended changes, either restrict backward navigation or redesign the Flow so database operations execute in a single, forward-moving step.
105
-
106
- **Rule ID:** `duplicate-dml`
107
- **Class Name:** _[DuplicateDMLOperation](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DuplicateDMLOperation.ts)_
108
- **Severity:** 🟑 *Warning*
109
-
110
- ### Missing Fault Path
111
- Elements that can fail should include a Fault Path to handle errors gracefully. Without it, failures show generic errors to users. Fault Paths improve reliability and user experience.
112
-
113
- **Rule ID:** `missing-fault-path`
114
- **Class Name:** _[MissingFaultPath](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFaultPath.ts)_
115
- **Severity:** 🟑 *Warning*
116
-
117
- ### Missing Null Handler
118
- Get Records operations return null when no data is found. Without handling these null values, Flows can fail or produce unintended results. Adding a null check improves reliability and ensures the Flow behaves as expected.
119
-
120
- **Rule ID:** `missing-null-handler`
121
- **Class Name:** _[MissingNullHandler](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingNullHandler.ts)_
122
- **Severity:** 🟑 *Warning*
123
-
124
- ### Recursive After Update
125
- After-save Flows that update the same record can trigger recursion, causing unintended behavior or performance issues. Avoid updating the triggering record in after-save Flows; use before-save Flows instead to prevent recursion.
126
-
127
- **Rule ID:** `recursive-record-update`
128
- **Class Name:** _[RecursiveAfterUpdate](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecursiveAfterUpdate.ts)_
129
- **Severity:** 🟑 *Warning*
130
-
131
-
132
-
133
- ### Suggestions
134
-
135
- ### Action Call In A Loop
136
- 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.
137
-
138
- **Rule ID:** `action-call-in-loop`
139
- **Class Name:** _[ActionCallsInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ActionCallsInLoop.ts)_
140
- **Severity:** 🟑 *Warning*
141
-
142
- ### Get Record All Fields
143
- Avoid using Get Records to retrieve all fields unless necessary. This improves performance, reduces processing time, and limits exposure of unnecessary data.
144
-
145
- **Rule ID:** `get-record-all-fields`
146
- **Class Name:** _[GetRecordAllFields](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/GetRecordAllFields.ts)_
147
- **Severity:** 🟑 *Warning*
148
-
149
- ### Inactive Flow
150
- Inactive Flows should be deleted or archived to reduce risk. Even when inactive, they can cause unintended record changes during testing or be activated as subflows. Keeping only active, relevant Flows improves safety and maintainability.
151
-
152
- **Rule ID:** `inactive-flow`
153
- **Class Name:** _[InactiveFlow](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/InactiveFlow.ts)_
154
- **Severity:** 🟑 *Warning*
155
-
156
- ### Invalid API Version
157
- Flows running on outdated API versions may behave inconsistently when newer platform features or components are used. From API version 50.0 onward, the API Version attribute explicitly controls Flow runtime behavior. Keeping Flows aligned with a supported API version helps prevent compatibility issues and ensures predictable execution.
158
-
159
- **Rule ID:** `invalid-api-version`
160
- **Class Name:** _[APIVersion](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/APIVersion.ts)_
161
- **Severity:** 🟑 *Warning*
162
-
163
- ### Missing Filter Record Trigger ![Beta](https://img.shields.io/badge/status-beta-yellow)
164
- Record-triggered Flows without filters on changed fields or entry conditions execute on every record change. Adding filters ensures the Flow runs only when needed, improving performance.
165
-
166
- **Rule ID:** `missing-record-trigger-filter`
167
- **Class Name:** _[MissingFilterRecordTrigger](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFilterRecordTrigger.ts)_
168
- **Severity:** 🟑 *Warning*
169
-
170
- ### Same Record Field Updates
171
- Before-save Flows can safely update the triggering record directly via $Record, applying changes efficiently without extra DML operations. Using before-save updates improves performance
172
-
173
- **Rule ID:** `same-record-field-updates`
174
- **Class Name:** _[SameRecordFieldUpdates](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SameRecordFieldUpdates.ts)_
175
- **Severity:** 🟑 *Warning*
176
-
177
- ### Excessive Cyclomatic Complexity
178
- High numbers of loops and decision elements increase a Flow's cyclomatic complexity. To maintain simplicity and readability, consider using subflows or splitting a Flow into smaller, ordered Flows.
179
-
180
- **Rule ID:** `excessive-cyclomatic-complexity`
181
- **Class Name:** _[CyclomaticComplexity](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CyclomaticComplexity.ts)_
182
- **Severity:** πŸ”΅ *Note*
183
-
184
- ### Missing Trigger Order
185
- Record-triggered Flows without a specified Trigger Order may execute in an unpredictable sequence. Setting a Trigger Order ensures your Flows run in the intended order.
186
-
187
- **Rule ID:** `unspecified-trigger-order`
188
- **Class Name:** _[TriggerOrder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TriggerOrder.ts)_
189
- **Severity:** πŸ”΅ *Note*
190
-
191
- ### Record ID as String ![Beta](https://img.shields.io/badge/status-beta-yellow)
192
- Flows that use a String variable for a record ID instead of receiving the full record introduce unnecessary complexity and additional Get Records queries. Using the complete record simplifies the Flow and improves performance.
193
-
194
- **Rule ID:** `record-id-as-string`
195
- **Class Name:** _[RecordIdAsString](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecordIdAsString.ts)_
196
- **Severity:** πŸ”΅ *Note*
197
-
198
- ### Transform Instead of Loop ![Beta](https://img.shields.io/badge/status-beta-yellow)
199
- Loop elements that perform direct Assignments on each item can slow down Flows. Using Transform elements allows bulk operations on collections, improving performance and reducing complexity.
200
-
201
- **Rule ID:** `transform-instead-of-loop`
202
- **Class Name:** _[TransformInsteadOfLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TransformInsteadOfLoop.ts)_
203
- **Severity:** πŸ”΅ *Note*
204
-
205
-
206
-
207
- ### Layout
208
-
209
- ### Flow Naming Convention
210
- Using clear and consistent Flow names improves readability, discoverability, and maintainability. A good naming convention helps team members quickly understand a Flow's purposeβ€”for example, including a domain and brief description like Service_OrderFulfillment. Adopt a naming pattern that aligns with your organization's standards.
211
-
212
- **Rule ID:** `invalid-naming-convention`
213
- **Class Name:** _[FlowName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowName.ts)_
214
- **Severity:** πŸ”΄ *Error*
215
-
216
- ### Missing Flow Description
217
- Flow descriptions are essential for documentation and maintainability. Include a description for each Flow, explaining its purpose and where it's used.
218
-
219
- **Rule ID:** `missing-flow-description`
220
- **Class Name:** _[FlowDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowDescription.ts)_
221
- **Severity:** πŸ”΄ *Error*
222
-
223
- ### Missing Metadata Description ![Beta](https://img.shields.io/badge/status-beta-yellow)
224
- Elements and metadata without a description reduce clarity and maintainability. Adding descriptions improves readability and makes your automation easier to understand.
225
-
226
- **Rule ID:** `missing-metadata-description`
227
- **Class Name:** _[MissingMetadataDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingMetadataDescription.ts)_
228
- **Severity:** 🟑 *Warning*
229
-
230
- ### Unclear API Name
231
- Elements with unclear or duplicated API names, like Copy_X_Of_Element, reduce Flow readability. Make sure to update the API name when copying elements to keep your Flow organized.
232
-
233
- **Rule ID:** `unclear-api-naming`
234
- **Class Name:** _[CopyAPIName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CopyAPIName.ts)_
235
- **Severity:** 🟑 *Warning*
236
-
237
- ### Unreachable Element
238
- Unconnected elements never execute and add unnecessary clutter. Remove or connect unused Flow elements to keep Flows clean and efficient.
239
-
240
- **Rule ID:** `unreachable-element`
241
- **Class Name:** _[UnconnectedElement](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnconnectedElement.ts)_
242
- **Severity:** 🟑 *Warning*
243
-
244
- ### Unused Variable
245
- Unused variables are never referenced and add unnecessary clutter. Remove them to keep Flows efficient and easy to maintain.
246
-
247
- **Rule ID:** `unused-variable`
248
- **Class Name:** _[UnusedVariable](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnusedVariable.ts)_
249
- **Severity:** 🟑 *Warning*
250
-
251
- ### Missing Auto Layout
252
- Auto-Layout automatically arranges and aligns Flow elements, keeping the canvas organized and easier to maintain. Enabling it saves time and improves readability.
253
-
254
- **Rule ID:** `missing-auto-layout`
255
- **Class Name:** _[AutoLayout](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/AutoLayout.ts)_
256
- **Severity:** πŸ”΅ *Note*
56
+ > Want to help improve this project? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=contributing-ov-file)
57
+
58
+ <!-- START GENERATED_RULES -->
59
+
60
+ ### Problems
61
+
62
+ Rules that detect issues highly likely to cause runtime errors, security risks, governor limit exceptions, or deployment failures.
63
+
64
+ #### DML Statement In A Loop
65
+ Executing DML operations (insert, update, delete) inside a loop is a high-risk anti-pattern that frequently causes governor limit exceptions. All database operations should be collected and executed once, outside the loop.
66
+ **Rule ID:** `dml-in-loop`
67
+ **Class Name:** _[DMLStatementInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DMLStatementInLoop.ts)_
68
+ **Severity:** πŸ”΄ *Error*
69
+
70
+ #### Hardcoded Id
71
+ Avoid hard-coding record IDs, as they are unique to a specific org and will not work in other environments. Instead, store IDs in variablesβ€”such as merge-field URL parameters or a **Get Records** elementβ€”to make the Flow portable, maintainable, and flexible.
72
+ **Rule ID:** `hardcoded-id`
73
+ **Class Name:** _[HardcodedId](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedId.ts)_
74
+ **Severity:** πŸ”΄ *Error*
75
+
76
+ #### Hardcoded Url
77
+ Avoid hard-coding URLs, as they may change between environments or over time. Instead, store URLs in variables or custom settings to make the Flow adaptable, maintainable, and environment-independent.
78
+ **Rule ID:** `hardcoded-url`
79
+ **Class Name:** _[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_
80
+ **Severity:** πŸ”΄ *Error*
81
+
82
+ #### Process Builder
83
+ Process Builder is retired. Continuing to use it increases maintenance overhead and risks future compatibility issues. Migrating automation to Flow reduces risk and improves maintainability.
84
+ **Rule ID:** `process-builder-usage`
85
+ **Class Name:** _[ProcessBuilder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ProcessBuilder.ts)_
86
+ **Severity:** πŸ”΄ *Error*
87
+
88
+ #### SOQL Query In A Loop
89
+ Running SOQL queries inside a loop can rapidly exceed query limits and severely degrade performance. Queries should be executed once, with results reused throughout the loop.
90
+ **Rule ID:** `soql-in-loop`
91
+ **Class Name:** _[SOQLQueryInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SOQLQueryInLoop.ts)_
92
+ **Severity:** πŸ”΄ *Error*
93
+
94
+ #### Unsafe Running Context
95
+ Flows configured to run in System Mode without Sharing grant access to all data, bypassing user permissions. Avoid this setting to prevent security risks and protect sensitive data.
96
+ **Rule ID:** `unsafe-running-context`
97
+ **Class Name:** _[UnsafeRunningContext](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnsafeRunningContext.ts)_
98
+ **Severity:** πŸ”΄ *Error*
99
+
100
+ #### Duplicate DML Operation
101
+ When a Flow performs database operations across multiple screens, users navigating backward can cause the same actions to run multiple times. To prevent unintended changes, either restrict backward navigation or redesign the Flow so database operations execute in a single, forward-moving step.
102
+ **Rule ID:** `duplicate-dml`
103
+ **Class Name:** _[DuplicateDMLOperation](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DuplicateDMLOperation.ts)_
104
+ **Severity:** 🟑 *Warning*
105
+
106
+ #### Missing Fault Path
107
+ Elements that can fail should include a Fault Path to handle errors gracefully. Without it, failures show generic errors to users. Fault Paths improve reliability and user experience.
108
+ **Rule ID:** `missing-fault-path`
109
+ **Class Name:** _[MissingFaultPath](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFaultPath.ts)_
110
+ **Severity:** 🟑 *Warning*
111
+
112
+ #### Missing Null Handler
113
+ Get Records operations return null when no data is found. Without handling these null values, Flows can fail or produce unintended results. Adding a null check improves reliability and ensures the Flow behaves as expected.
114
+ **Rule ID:** `missing-null-handler`
115
+ **Class Name:** _[MissingNullHandler](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingNullHandler.ts)_
116
+ **Severity:** 🟑 *Warning*
117
+
118
+ #### Recursive After Update
119
+ After-save Flows that update the same record can trigger recursion, causing unintended behavior or performance issues. Avoid updating the triggering record in after-save Flows; use before-save Flows instead to prevent recursion.
120
+ **Rule ID:** `recursive-record-update`
121
+ **Class Name:** _[RecursiveAfterUpdate](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecursiveAfterUpdate.ts)_
122
+ **Severity:** 🟑 *Warning*
123
+
124
+
125
+ ### Suggestions
126
+
127
+ Rules in this category recommend better patterns and optimizations related to performance, bulkification, trigger behavior, and overall design. Following them improves efficiency and long-term maintainability without affecting correctness.
128
+
129
+ #### Action Call In A Loop
130
+ 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.
131
+ **Rule ID:** `action-call-in-loop`
132
+ **Class Name:** _[ActionCallsInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ActionCallsInLoop.ts)_
133
+ **Severity:** 🟑 *Warning*
134
+
135
+ #### Get Record All Fields
136
+ Avoid using Get Records to retrieve all fields unless necessary. This improves performance, reduces processing time, and limits exposure of unnecessary data.
137
+ **Rule ID:** `get-record-all-fields`
138
+ **Class Name:** _[GetRecordAllFields](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/GetRecordAllFields.ts)_
139
+ **Severity:** 🟑 *Warning*
140
+
141
+ #### Inactive Flow
142
+ Inactive Flows should be deleted or archived to reduce risk. Even when inactive, they can cause unintended record changes during testing or be activated as subflows. Keeping only active, relevant Flows improves safety and maintainability.
143
+ **Rule ID:** `inactive-flow`
144
+ **Class Name:** _[InactiveFlow](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/InactiveFlow.ts)_
145
+ **Severity:** 🟑 *Warning*
146
+
147
+ #### Invalid API Version
148
+ Flows running on outdated API versions may behave inconsistently when newer platform features or components are used. From API version 50.0 onward, the API Version attribute explicitly controls Flow runtime behavior. Keeping Flows aligned with a supported API version helps prevent compatibility issues and ensures predictable execution.
149
+ **Rule ID:** `invalid-api-version`
150
+ **Class Name:** _[APIVersion](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/APIVersion.ts)_
151
+ **Severity:** 🟑 *Warning*
152
+
153
+ #### Missing Filter Record Trigger ![Beta](https://img.shields.io/badge/status-beta-yellow)
154
+ Record-triggered Flows without filters on changed fields or entry conditions execute on every record change. Adding filters ensures the Flow runs only when needed, improving performance.
155
+ **Rule ID:** `missing-record-trigger-filter`
156
+ **Class Name:** _[MissingFilterRecordTrigger](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFilterRecordTrigger.ts)_
157
+ **Severity:** 🟑 *Warning*
158
+
159
+ #### Same Record Field Updates
160
+ Before-save Flows can safely update the triggering record directly via $Record, applying changes efficiently without extra DML operations. Using before-save updates improves performance
161
+ **Rule ID:** `same-record-field-updates`
162
+ **Class Name:** _[SameRecordFieldUpdates](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SameRecordFieldUpdates.ts)_
163
+ **Severity:** 🟑 *Warning*
164
+
165
+ #### Excessive Cyclomatic Complexity
166
+ High numbers of loops and decision elements increase a Flow's cyclomatic complexity. To maintain simplicity and readability, consider using subflows or splitting a Flow into smaller, ordered Flows.
167
+ **Rule ID:** `excessive-cyclomatic-complexity`
168
+ **Class Name:** _[CyclomaticComplexity](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CyclomaticComplexity.ts)_
169
+ **Severity:** πŸ”΅ *Note*
170
+
171
+ #### Missing Trigger Order
172
+ Record-triggered Flows without a specified Trigger Order may execute in an unpredictable sequence. Setting a Trigger Order ensures your Flows run in the intended order.
173
+ **Rule ID:** `unspecified-trigger-order`
174
+ **Class Name:** _[TriggerOrder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TriggerOrder.ts)_
175
+ **Severity:** πŸ”΅ *Note*
176
+
177
+ #### Record ID as String ![Beta](https://img.shields.io/badge/status-beta-yellow)
178
+ Flows that use a String variable for a record ID instead of receiving the full record introduce unnecessary complexity and additional Get Records queries. Using the complete record simplifies the Flow and improves performance.
179
+ **Rule ID:** `record-id-as-string`
180
+ **Class Name:** _[RecordIdAsString](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecordIdAsString.ts)_
181
+ **Severity:** πŸ”΅ *Note*
182
+
183
+ #### Transform Instead of Loop ![Beta](https://img.shields.io/badge/status-beta-yellow)
184
+ Loop elements that perform direct Assignments on each item can slow down Flows. Using Transform elements allows bulk operations on collections, improving performance and reducing complexity.
185
+ **Rule ID:** `transform-instead-of-loop`
186
+ **Class Name:** _[TransformInsteadOfLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TransformInsteadOfLoop.ts)_
187
+ **Severity:** πŸ”΅ *Note*
188
+
189
+
190
+ ### Layout
191
+
192
+ Rules in this category enforce consistency in naming, documentation, element organization, and visual layout. They help ensure Flows remain readable, well-documented, and structured as automations scale.
193
+
194
+ #### Flow Naming Convention
195
+ Using clear and consistent Flow names improves readability, discoverability, and maintainability. A good naming convention helps team members quickly understand a Flow's purposeβ€”for example, including a domain and brief description like Service_OrderFulfillment. Adopt a naming pattern that aligns with your organization's standards.
196
+ **Rule ID:** `invalid-naming-convention`
197
+ **Class Name:** _[FlowName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowName.ts)_
198
+ **Severity:** πŸ”΄ *Error*
199
+
200
+ #### Missing Flow Description
201
+ Flow descriptions are essential for documentation and maintainability. Include a description for each Flow, explaining its purpose and where it's used.
202
+ **Rule ID:** `missing-flow-description`
203
+ **Class Name:** _[FlowDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowDescription.ts)_
204
+ **Severity:** πŸ”΄ *Error*
205
+
206
+ #### Missing Metadata Description ![Beta](https://img.shields.io/badge/status-beta-yellow)
207
+ Elements and metadata without a description reduce clarity and maintainability. Adding descriptions improves readability and makes your automation easier to understand.
208
+ **Rule ID:** `missing-metadata-description`
209
+ **Class Name:** _[MissingMetadataDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingMetadataDescription.ts)_
210
+ **Severity:** 🟑 *Warning*
211
+
212
+ #### Unclear API Name
213
+ Elements with unclear or duplicated API names, like Copy_X_Of_Element, reduce Flow readability. Make sure to update the API name when copying elements to keep your Flow organized.
214
+ **Rule ID:** `unclear-api-naming`
215
+ **Class Name:** _[CopyAPIName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CopyAPIName.ts)_
216
+ **Severity:** 🟑 *Warning*
217
+
218
+ #### Unreachable Element
219
+ Unconnected elements never execute and add unnecessary clutter. Remove or connect unused Flow elements to keep Flows clean and efficient.
220
+ **Rule ID:** `unreachable-element`
221
+ **Class Name:** _[UnconnectedElement](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnconnectedElement.ts)_
222
+ **Severity:** 🟑 *Warning*
223
+
224
+ #### Unused Variable
225
+ Unused variables are never referenced and add unnecessary clutter. Remove them to keep Flows efficient and easy to maintain.
226
+ **Rule ID:** `unused-variable`
227
+ **Class Name:** _[UnusedVariable](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnusedVariable.ts)_
228
+ **Severity:** 🟑 *Warning*
229
+
230
+ #### Missing Auto Layout
231
+ Auto-Layout automatically arranges and aligns Flow elements, keeping the canvas organized and easier to maintain. Enabling it saves time and improves readability.
232
+ **Rule ID:** `missing-auto-layout`
233
+ **Class Name:** _[AutoLayout](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/AutoLayout.ts)_
234
+ **Severity:** πŸ”΅ *Note*
257
235
  <!-- END GENERATED_RULES -->
258
236
 
259
237
  ---
@@ -628,4 +606,3 @@ For more on Programmatic API, types, and advanced usage of `@flow-scanner/lightn
628
606
  ```
629
607
  This creates UMD at `dist/lightning-flow-scanner-core.umd.js`.
630
608
 
631
- **Want to help improve Lightning Flow Scanner? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=contributing-ov-file)**
@@ -52,10 +52,12 @@ _define_property(FlowType, "surveyTypes", [
52
52
  "Survey"
53
53
  ]);
54
54
  _define_property(FlowType, "unsupportedTypes", [
55
+ "ActionPlan",
56
+ "UserProvisioningFlow",
55
57
  "CheckoutFlow",
56
58
  "FSCLending",
57
- "FSCLending",
58
- "LoyaltyManagementFlow"
59
+ "LoyaltyManagementFlow",
60
+ "JourneyBuilderIntegration"
59
61
  ]);
60
62
  _define_property(FlowType, "visualTypes", [
61
63
  "Flow",
@@ -65,7 +67,6 @@ _define_property(FlowType, "visualTypes", [
65
67
  "Appointments",
66
68
  "ActionCadenceStepFlow",
67
69
  "ContactRequestFlow",
68
- "ContactRequestFlow",
69
70
  "CustomerLifecycle",
70
71
  "FieldServiceMobile",
71
72
  "FieldServiceWeb",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flow-scanner/lightning-flow-scanner-core",
3
3
  "description": "A lightweight engine for Flow metadata in Node.js, and browser environments. Assess and enhance Salesforce Flow automations for best practices, security, governor limits, and performance issues.",
4
- "version": "6.15.2",
4
+ "version": "6.16.1",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": {