Skip to content

Commit acb6107

Browse files
committed
feat(vsx): Cognitive Complexity
1 parent e628ea6 commit acb6107

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/vsx/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,27 +84,27 @@ Executing DML operations (insert, update, delete) inside a loop is a high-risk a
8484
**Class Name:** _[DMLStatementInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DMLStatementInLoop.ts)_
8585
**Severity:** 🔴 *Error*
8686

87-
#### Hardcoded Salesforce Id
87+
#### Hardcoded Id
8888
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.
8989

9090
**Rule ID:** `hardcoded-id`
9191
**Class Name:** _[HardcodedId](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedId.ts)_
9292
**Severity:** 🔴 *Error*
9393

94-
#### Hardcoded Salesforce Url
95-
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.
96-
97-
**Rule ID:** `hardcoded-url`
98-
**Class Name:** _[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_
99-
**Severity:** 🔴 *Error*
100-
10194
#### Hardcoded Secret ![Beta](https://img.shields.io/badge/status-beta-yellow)
10295
Avoid hardcoding secrets, API keys, tokens, or credentials in Flows. These should be stored securely in Named Credentials, Custom Settings, Custom Metadata, or external secret management systems.
10396

10497
**Rule ID:** `hardcoded-secret`
10598
**Class Name:** _[HardcodedSecret](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedSecret.ts)_
10699
**Severity:** 🔴 *Error*
107100

101+
#### Hardcoded Url
102+
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.
103+
104+
**Rule ID:** `hardcoded-url`
105+
**Class Name:** _[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_
106+
**Severity:** 🔴 *Error*
107+
108108
#### Process Builder
109109
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.
110110

@@ -207,7 +207,7 @@ Before-save Flows can safely update the triggering record directly via $Record,
207207
**Class Name:** _[SameRecordFieldUpdates](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SameRecordFieldUpdates.ts)_
208208
**Severity:** 🟡 *Warning*
209209

210-
#### Cognitive Complexity
210+
#### Cognitive Complexity ![Beta](https://img.shields.io/badge/status-beta-yellow)
211211
Flows with deeply nested loops and decisions are hard to understand. Unlike cyclomatic complexity which counts paths, cognitive complexity penalizes nesting depth. Consider extracting nested logic into subflows.
212212

213213
**Rule ID:** `cognitive-complexity`

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.3.1",
13+
"version": "3.4.0",
1414
"engines": {
1515
"vscode": "^1.92.0"
1616
},

0 commit comments

Comments
 (0)