Skip to content

Commit 7b3e360

Browse files
committed
chore(vsx): improve category documentation
1 parent 66641a3 commit 7b3e360

2 files changed

Lines changed: 38 additions & 57 deletions

File tree

packages/vsx/README.md

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737

3838
- **[Usage](#usage)**
3939
- **[Default Rules](#default-rules)**
40+
- [Problems](#problems)
41+
- [Suggestions](#suggestions)
42+
- [Layout](#layout)
4043
- **[Configuration](#configuration)**
4144
- **[Installation](#installation)**
4245
- **[Development](#development)**
@@ -67,201 +70,179 @@ Lightning Flow Scanner VSX is plug-and-play. Open any project with flows and use
6770
> Want to help improve this project? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=contributing-ov-file)
6871
6972
<!-- START GENERATED_RULES -->
73+
7074
### Problems
7175

72-
### DML Statement In A Loop
73-
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.
76+
Rules that detect issues highly likely to cause runtime errors, security risks, governor limit exceptions, or deployment failures.
7477

78+
#### DML Statement In A Loop
79+
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.
7580
**Rule ID:** `dml-in-loop`
7681
**Class Name:** _[DMLStatementInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DMLStatementInLoop.ts)_
7782
**Severity:** 🔴 *Error*
7883

79-
### Hardcoded Id
84+
#### Hardcoded Id
8085
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.
81-
8286
**Rule ID:** `hardcoded-id`
8387
**Class Name:** _[HardcodedId](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedId.ts)_
8488
**Severity:** 🔴 *Error*
8589

86-
### Hardcoded Url
90+
#### Hardcoded Url
8791
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.
88-
8992
**Rule ID:** `hardcoded-url`
9093
**Class Name:** _[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_
9194
**Severity:** 🔴 *Error*
9295

93-
### Process Builder
96+
#### Process Builder
9497
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.
95-
9698
**Rule ID:** `process-builder-usage`
9799
**Class Name:** _[ProcessBuilder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ProcessBuilder.ts)_
98100
**Severity:** 🔴 *Error*
99101

100-
### SOQL Query In A Loop
102+
#### SOQL Query In A Loop
101103
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.
102-
103104
**Rule ID:** `soql-in-loop`
104105
**Class Name:** _[SOQLQueryInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SOQLQueryInLoop.ts)_
105106
**Severity:** 🔴 *Error*
106107

107-
### Unsafe Running Context
108+
#### Unsafe Running Context
108109
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.
109-
110110
**Rule ID:** `unsafe-running-context`
111111
**Class Name:** _[UnsafeRunningContext](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnsafeRunningContext.ts)_
112112
**Severity:** 🔴 *Error*
113113

114-
### Duplicate DML Operation
114+
#### Duplicate DML Operation
115115
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.
116-
117116
**Rule ID:** `duplicate-dml`
118117
**Class Name:** _[DuplicateDMLOperation](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DuplicateDMLOperation.ts)_
119118
**Severity:** 🟡 *Warning*
120119

121-
### Missing Fault Path
120+
#### Missing Fault Path
122121
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.
123-
124122
**Rule ID:** `missing-fault-path`
125123
**Class Name:** _[MissingFaultPath](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFaultPath.ts)_
126124
**Severity:** 🟡 *Warning*
127125

128-
### Missing Null Handler
126+
#### Missing Null Handler
129127
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.
130-
131128
**Rule ID:** `missing-null-handler`
132129
**Class Name:** _[MissingNullHandler](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingNullHandler.ts)_
133130
**Severity:** 🟡 *Warning*
134131

135-
### Recursive After Update
132+
#### Recursive After Update
136133
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.
137-
138134
**Rule ID:** `recursive-record-update`
139135
**Class Name:** _[RecursiveAfterUpdate](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecursiveAfterUpdate.ts)_
140136
**Severity:** 🟡 *Warning*
141137

142138

143-
144139
### Suggestions
145140

146-
### Action Call In A Loop
147-
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.
141+
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.
148142

143+
#### Action Call In A Loop
144+
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.
149145
**Rule ID:** `action-call-in-loop`
150146
**Class Name:** _[ActionCallsInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ActionCallsInLoop.ts)_
151147
**Severity:** 🟡 *Warning*
152148

153-
### Get Record All Fields
149+
#### Get Record All Fields
154150
Avoid using Get Records to retrieve all fields unless necessary. This improves performance, reduces processing time, and limits exposure of unnecessary data.
155-
156151
**Rule ID:** `get-record-all-fields`
157152
**Class Name:** _[GetRecordAllFields](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/GetRecordAllFields.ts)_
158153
**Severity:** 🟡 *Warning*
159154

160-
### Inactive Flow
155+
#### Inactive Flow
161156
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.
162-
163157
**Rule ID:** `inactive-flow`
164158
**Class Name:** _[InactiveFlow](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/InactiveFlow.ts)_
165159
**Severity:** 🟡 *Warning*
166160

167-
### Invalid API Version
161+
#### Invalid API Version
168162
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.
169-
170163
**Rule ID:** `invalid-api-version`
171164
**Class Name:** _[APIVersion](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/APIVersion.ts)_
172165
**Severity:** 🟡 *Warning*
173166

174-
### Missing Filter Record Trigger ![Beta](https://img.shields.io/badge/status-beta-yellow)
167+
#### Missing Filter Record Trigger ![Beta](https://img.shields.io/badge/status-beta-yellow)
175168
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.
176-
177169
**Rule ID:** `missing-record-trigger-filter`
178170
**Class Name:** _[MissingFilterRecordTrigger](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFilterRecordTrigger.ts)_
179171
**Severity:** 🟡 *Warning*
180172

181-
### Same Record Field Updates
173+
#### Same Record Field Updates
182174
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
183-
184175
**Rule ID:** `same-record-field-updates`
185176
**Class Name:** _[SameRecordFieldUpdates](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SameRecordFieldUpdates.ts)_
186177
**Severity:** 🟡 *Warning*
187178

188-
### Excessive Cyclomatic Complexity
179+
#### Excessive Cyclomatic Complexity
189180
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.
190-
191181
**Rule ID:** `excessive-cyclomatic-complexity`
192182
**Class Name:** _[CyclomaticComplexity](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CyclomaticComplexity.ts)_
193183
**Severity:** 🔵 *Note*
194184

195-
### Missing Trigger Order
185+
#### Missing Trigger Order
196186
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.
197-
198187
**Rule ID:** `unspecified-trigger-order`
199188
**Class Name:** _[TriggerOrder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TriggerOrder.ts)_
200189
**Severity:** 🔵 *Note*
201190

202-
### Record ID as String ![Beta](https://img.shields.io/badge/status-beta-yellow)
191+
#### Record ID as String ![Beta](https://img.shields.io/badge/status-beta-yellow)
203192
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.
204-
205193
**Rule ID:** `record-id-as-string`
206194
**Class Name:** _[RecordIdAsString](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecordIdAsString.ts)_
207195
**Severity:** 🔵 *Note*
208196

209-
### Transform Instead of Loop ![Beta](https://img.shields.io/badge/status-beta-yellow)
197+
#### Transform Instead of Loop ![Beta](https://img.shields.io/badge/status-beta-yellow)
210198
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.
211-
212199
**Rule ID:** `transform-instead-of-loop`
213200
**Class Name:** _[TransformInsteadOfLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TransformInsteadOfLoop.ts)_
214201
**Severity:** 🔵 *Note*
215202

216203

217-
218204
### Layout
219205

220-
### Flow Naming Convention
221-
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.
206+
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.
222207

208+
#### Flow Naming Convention
209+
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.
223210
**Rule ID:** `invalid-naming-convention`
224211
**Class Name:** _[FlowName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowName.ts)_
225212
**Severity:** 🔴 *Error*
226213

227-
### Missing Flow Description
214+
#### Missing Flow Description
228215
Flow descriptions are essential for documentation and maintainability. Include a description for each Flow, explaining its purpose and where it's used.
229-
230216
**Rule ID:** `missing-flow-description`
231217
**Class Name:** _[FlowDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowDescription.ts)_
232218
**Severity:** 🔴 *Error*
233219

234-
### Missing Metadata Description ![Beta](https://img.shields.io/badge/status-beta-yellow)
220+
#### Missing Metadata Description ![Beta](https://img.shields.io/badge/status-beta-yellow)
235221
Elements and metadata without a description reduce clarity and maintainability. Adding descriptions improves readability and makes your automation easier to understand.
236-
237222
**Rule ID:** `missing-metadata-description`
238223
**Class Name:** _[MissingMetadataDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingMetadataDescription.ts)_
239224
**Severity:** 🟡 *Warning*
240225

241-
### Unclear API Name
226+
#### Unclear API Name
242227
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.
243-
244228
**Rule ID:** `unclear-api-naming`
245229
**Class Name:** _[CopyAPIName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CopyAPIName.ts)_
246230
**Severity:** 🟡 *Warning*
247231

248-
### Unreachable Element
232+
#### Unreachable Element
249233
Unconnected elements never execute and add unnecessary clutter. Remove or connect unused Flow elements to keep Flows clean and efficient.
250-
251234
**Rule ID:** `unreachable-element`
252235
**Class Name:** _[UnconnectedElement](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnconnectedElement.ts)_
253236
**Severity:** 🟡 *Warning*
254237

255-
### Unused Variable
238+
#### Unused Variable
256239
Unused variables are never referenced and add unnecessary clutter. Remove them to keep Flows efficient and easy to maintain.
257-
258240
**Rule ID:** `unused-variable`
259241
**Class Name:** _[UnusedVariable](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnusedVariable.ts)_
260242
**Severity:** 🟡 *Warning*
261243

262-
### Missing Auto Layout
244+
#### Missing Auto Layout
263245
Auto-Layout automatically arranges and aligns Flow elements, keeping the canvas organized and easier to maintain. Enabling it saves time and improves readability.
264-
265246
**Rule ID:** `missing-auto-layout`
266247
**Class Name:** _[AutoLayout](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/AutoLayout.ts)_
267248
**Severity:** 🔵 *Note*

packages/vsx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"icon": "media/lightningflow.png",
1212
"description": "A VS Code Extension for analysis and optimization of Salesforce Flows. Scans metadata for 20+ issues such as hardcoded IDs, unsafe contexts, inefficient SOQL/DML operations, recursion risks, and missing fault handling. Supports auto-fixes, rule configurations, and tests integration.",
13-
"version": "3.1.0",
13+
"version": "3.1.1",
1414
"engines": {
1515
"vscode": "^1.92.0"
1616
},

0 commit comments

Comments
 (0)