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

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.
Files changed (2) hide show
  1. package/README.md +213 -186
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -55,183 +55,214 @@
55
55
 
56
56
  > Want to help improve this project? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=contributing-ov-file)
57
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*
58
+ <!-- START GENERATED_RULES -->
59
+
60
+ ---
61
+
62
+ ### Problems
63
+
64
+ These rules detect anti-patterns and unsafe practices in your Flows that could break functionality, compromise security, or cause deployment failures.
65
+
66
+ #### DML Statement In A Loop
67
+ 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.
68
+
69
+ **Rule ID:** `dml-in-loop`
70
+ **Class Name:** _[DMLStatementInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DMLStatementInLoop.ts)_
71
+ **Severity:** πŸ”΄ *Error*
72
+
73
+ #### Hardcoded Id
74
+ 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.
75
+
76
+ **Rule ID:** `hardcoded-id`
77
+ **Class Name:** _[HardcodedId](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedId.ts)_
78
+ **Severity:** πŸ”΄ *Error*
79
+
80
+ #### Hardcoded Url
81
+ 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.
82
+
83
+ **Rule ID:** `hardcoded-url`
84
+ **Class Name:** _[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_
85
+ **Severity:** πŸ”΄ *Error*
86
+
87
+ #### Process Builder
88
+ 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.
89
+
90
+ **Rule ID:** `process-builder-usage`
91
+ **Class Name:** _[ProcessBuilder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ProcessBuilder.ts)_
92
+ **Severity:** πŸ”΄ *Error*
93
+
94
+ #### SOQL Query In A Loop
95
+ 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.
96
+
97
+ **Rule ID:** `soql-in-loop`
98
+ **Class Name:** _[SOQLQueryInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SOQLQueryInLoop.ts)_
99
+ **Severity:** πŸ”΄ *Error*
100
+
101
+ #### Unsafe Running Context
102
+ 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.
103
+
104
+ **Rule ID:** `unsafe-running-context`
105
+ **Class Name:** _[UnsafeRunningContext](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnsafeRunningContext.ts)_
106
+ **Severity:** πŸ”΄ *Error*
107
+
108
+ #### Duplicate DML Operation
109
+ 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.
110
+
111
+ **Rule ID:** `duplicate-dml`
112
+ **Class Name:** _[DuplicateDMLOperation](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DuplicateDMLOperation.ts)_
113
+ **Severity:** 🟑 *Warning*
114
+
115
+ #### Missing Fault Path
116
+ 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.
117
+
118
+ **Rule ID:** `missing-fault-path`
119
+ **Class Name:** _[MissingFaultPath](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFaultPath.ts)_
120
+ **Severity:** 🟑 *Warning*
121
+
122
+ #### Missing Null Handler
123
+ 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.
124
+
125
+ **Rule ID:** `missing-null-handler`
126
+ **Class Name:** _[MissingNullHandler](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingNullHandler.ts)_
127
+ **Severity:** 🟑 *Warning*
128
+
129
+ #### Recursive After Update
130
+ 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.
131
+
132
+ **Rule ID:** `recursive-record-update`
133
+ **Class Name:** _[RecursiveAfterUpdate](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecursiveAfterUpdate.ts)_
134
+ **Severity:** 🟑 *Warning*
135
+
136
+ ---
137
+
138
+ ### Suggestions
139
+
140
+ These rules highlight areas where Flows can be improved. Following them increases reliability and long-term maintainability.
141
+
142
+ #### Action Call In A Loop
143
+ 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.
144
+
145
+ **Rule ID:** `action-call-in-loop`
146
+ **Class Name:** _[ActionCallsInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ActionCallsInLoop.ts)_
147
+ **Severity:** 🟑 *Warning*
148
+
149
+ #### Get Record All Fields
150
+ Avoid using Get Records to retrieve all fields unless necessary. This improves performance, reduces processing time, and limits exposure of unnecessary data.
151
+
152
+ **Rule ID:** `get-record-all-fields`
153
+ **Class Name:** _[GetRecordAllFields](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/GetRecordAllFields.ts)_
154
+ **Severity:** 🟑 *Warning*
155
+
156
+ #### Inactive Flow
157
+ 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.
158
+
159
+ **Rule ID:** `inactive-flow`
160
+ **Class Name:** _[InactiveFlow](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/InactiveFlow.ts)_
161
+ **Severity:** 🟑 *Warning*
162
+
163
+ #### Invalid API Version
164
+ 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.
165
+
166
+ **Rule ID:** `invalid-api-version`
167
+ **Class Name:** _[APIVersion](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/APIVersion.ts)_
168
+ **Severity:** 🟑 *Warning*
169
+
170
+ #### Missing Filter Record Trigger ![Beta](https://img.shields.io/badge/status-beta-yellow)
171
+ 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.
172
+
173
+ **Rule ID:** `missing-record-trigger-filter`
174
+ **Class Name:** _[MissingFilterRecordTrigger](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFilterRecordTrigger.ts)_
175
+ **Severity:** 🟑 *Warning*
176
+
177
+ #### Same Record Field Updates
178
+ 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
179
+
180
+ **Rule ID:** `same-record-field-updates`
181
+ **Class Name:** _[SameRecordFieldUpdates](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SameRecordFieldUpdates.ts)_
182
+ **Severity:** 🟑 *Warning*
183
+
184
+ #### Excessive Cyclomatic Complexity
185
+ 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.
186
+
187
+ **Rule ID:** `excessive-cyclomatic-complexity`
188
+ **Class Name:** _[CyclomaticComplexity](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CyclomaticComplexity.ts)_
189
+ **Severity:** πŸ”΅ *Note*
190
+
191
+ #### Missing Trigger Order
192
+ 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.
193
+
194
+ **Rule ID:** `unspecified-trigger-order`
195
+ **Class Name:** _[TriggerOrder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TriggerOrder.ts)_
196
+ **Severity:** πŸ”΅ *Note*
197
+
198
+ #### Record ID as String ![Beta](https://img.shields.io/badge/status-beta-yellow)
199
+ 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.
200
+
201
+ **Rule ID:** `record-id-as-string`
202
+ **Class Name:** _[RecordIdAsString](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecordIdAsString.ts)_
203
+ **Severity:** πŸ”΅ *Note*
204
+
205
+ #### Transform Instead of Loop ![Beta](https://img.shields.io/badge/status-beta-yellow)
206
+ 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.
207
+
208
+ **Rule ID:** `transform-instead-of-loop`
209
+ **Class Name:** _[TransformInsteadOfLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TransformInsteadOfLoop.ts)_
210
+ **Severity:** πŸ”΅ *Note*
211
+
212
+ ---
213
+
214
+ ### Layout
215
+
216
+ Focused on naming, documentation, and organization, these rules ensure Flows remain clear, easy to understand, and maintainable as automations grow.
217
+
218
+ #### Flow Naming Convention
219
+ 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.
220
+
221
+ **Rule ID:** `invalid-naming-convention`
222
+ **Class Name:** _[FlowName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowName.ts)_
223
+ **Severity:** πŸ”΄ *Error*
224
+
225
+ #### Missing Flow Description
226
+ Flow descriptions are essential for documentation and maintainability. Include a description for each Flow, explaining its purpose and where it's used.
227
+
228
+ **Rule ID:** `missing-flow-description`
229
+ **Class Name:** _[FlowDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowDescription.ts)_
230
+ **Severity:** πŸ”΄ *Error*
231
+
232
+ #### Missing Metadata Description ![Beta](https://img.shields.io/badge/status-beta-yellow)
233
+ Elements and metadata without a description reduce clarity and maintainability. Adding descriptions improves readability and makes your automation easier to understand.
234
+
235
+ **Rule ID:** `missing-metadata-description`
236
+ **Class Name:** _[MissingMetadataDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingMetadataDescription.ts)_
237
+ **Severity:** 🟑 *Warning*
238
+
239
+ #### Unclear API Name
240
+ 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.
241
+
242
+ **Rule ID:** `unclear-api-naming`
243
+ **Class Name:** _[CopyAPIName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CopyAPIName.ts)_
244
+ **Severity:** 🟑 *Warning*
245
+
246
+ #### Unreachable Element
247
+ Unconnected elements never execute and add unnecessary clutter. Remove or connect unused Flow elements to keep Flows clean and efficient.
248
+
249
+ **Rule ID:** `unreachable-element`
250
+ **Class Name:** _[UnconnectedElement](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnconnectedElement.ts)_
251
+ **Severity:** 🟑 *Warning*
252
+
253
+ #### Unused Variable
254
+ Unused variables are never referenced and add unnecessary clutter. Remove them to keep Flows efficient and easy to maintain.
255
+
256
+ **Rule ID:** `unused-variable`
257
+ **Class Name:** _[UnusedVariable](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnusedVariable.ts)_
258
+ **Severity:** 🟑 *Warning*
259
+
260
+ #### Missing Auto Layout
261
+ Auto-Layout automatically arranges and aligns Flow elements, keeping the canvas organized and easier to maintain. Enabling it saves time and improves readability.
262
+
263
+ **Rule ID:** `missing-auto-layout`
264
+ **Class Name:** _[AutoLayout](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/AutoLayout.ts)_
265
+ **Severity:** πŸ”΅ *Note*
235
266
  <!-- END GENERATED_RULES -->
236
267
 
237
268
  ---
@@ -385,7 +416,7 @@ Use glob patterns to exclude flows based on their file system location. This is
385
416
  }
386
417
  ```
387
418
 
388
- **Environment compatibility**: `ignore` requires Node.js (file system access) and is available in CLI Plugin, VS Code Extension, and GitHub Action. It is **not** available when using the Core Library in browser/web environments.
419
+ **Environment compatibility**: requires Node.js(file system access) and is not available when using the Core Library in browser/web environments.
389
420
 
390
421
  #### Exclude by Flow API Name (Browser-compatible)
391
422
 
@@ -404,7 +435,7 @@ Exclude specific flows by their unique API names, regardless of their location.
404
435
  }
405
436
  ```
406
437
 
407
- **Environment compatibility**: `ignoreFlows` works in **all environments** including Node.js and browser/web distributions, as it operates on parsed flow data rather than file system paths.
438
+ **Environment compatibility**: works in **all environments** including Node.js and browser/web distributions, as it operates on parsed flow data rather than file system paths.
408
439
 
409
440
  ### Scan Modes
410
441
 
@@ -413,18 +444,14 @@ Exclude specific flows by their unique API names, regardless of their location.
413
444
  New rules are introduced in Beta mode before being added to the default ruleset. To include current Beta rules, enable the optional betamode parameter in your configuration:
414
445
 
415
446
  ```json
416
- {
417
- "betaMode": true
418
- }
447
+ { "betaMode": true }
419
448
  ```
420
449
 
421
450
  #### Rule Mode
422
451
 
423
- By default, Lightning Flow Scanner runs **all** default rules and merges any custom configurations you provide. This means you can override specific rules without having to list every rule to be executed. If instead, you want to run **only** the rules you explicitly specify, use `"ruleMode": "isolated"`:
452
+ By default, Lightning Flow Scanner runs **all** default rules and merges any custom configurations you provide. If instead, you want to run **only** the rules you explicitly specify, use:
424
453
  ```json
425
- {
426
- "ruleMode": "isolated"
427
- }
454
+ { "ruleMode": "isolated" }
428
455
  ```
429
456
 
430
457
  ## Installation
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.16.1",
4
+ "version": "6.16.2",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": {