@flow-scanner/lightning-flow-scanner-core 6.6.3 → 6.6.5
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/CONTRIBUTING.md +1 -1
- package/README.md +42 -59
- package/SECURITY.md +10 -0
- package/main/interfaces/IRuleDefinition.d.ts +0 -1
- package/main/internals/internals.d.ts +2 -2
- package/main/internals/internals.js +0 -4
- package/main/models/RuleCommon.d.ts +0 -1
- package/main/models/RuleCommon.js +8 -4
- package/main/models/RuleInfo.d.ts +0 -15
- package/main/models/RuleInfo.js +0 -13
- package/main/rules/APIVersion.js +1 -3
- package/main/rules/ActionCallsInLoop.js +0 -2
- package/main/rules/AutoLayout.js +1 -3
- package/main/rules/CopyAPIName.js +1 -3
- package/main/rules/CyclomaticComplexity.js +1 -3
- package/main/rules/DMLStatementInLoop.js +0 -2
- package/main/rules/DuplicateDMLOperation.js +1 -3
- package/main/rules/FlowDescription.js +0 -2
- package/main/rules/FlowName.js +0 -2
- package/main/rules/GetRecordAllFields.js +0 -2
- package/main/rules/HardcodedId.js +1 -3
- package/main/rules/HardcodedUrl.js +0 -2
- package/main/rules/InactiveFlow.js +1 -3
- package/main/rules/MissingFaultPath.js +0 -2
- package/main/rules/MissingMetadataDescription.js +0 -2
- package/main/rules/MissingNullHandler.js +0 -2
- package/main/rules/ProcessBuilder.js +1 -3
- package/main/rules/RecursiveAfterUpdate.js +0 -2
- package/main/rules/SOQLQueryInLoop.js +0 -2
- package/main/rules/SameRecordFieldUpdates.js +1 -3
- package/main/rules/TriggerOrder.js +1 -3
- package/main/rules/UnconnectedElement.js +0 -2
- package/main/rules/UnsafeRunningContext.js +1 -3
- package/main/rules/UnusedVariable.js +1 -3
- package/package.json +3 -3
package/CONTRIBUTING.md
CHANGED
|
@@ -26,6 +26,6 @@ If it's more specific like a bug or a new feature—use [GitHub Issues](https://
|
|
|
26
26
|
- [Copado Plugin](https://github.com/Flow-Scanner/lightning-flow-scanner-copado/issues)
|
|
27
27
|
- [GitHub Action](https://github.com/Flow-Scanner/lightning-flow-scanner/issues)
|
|
28
28
|
- [Salesforce App](https://github.com/Flow-Scanner/lightning-flow-scanner-app/issues)
|
|
29
|
-
- [VS Code/Code Builder](https://github.com/Flow-Scanner/lightning-flow-scanner
|
|
29
|
+
- [VS Code/Code Builder](https://github.com/Flow-Scanner/lightning-flow-scanner/issues)
|
|
30
30
|
|
|
31
31
|
###### Thank you
|
package/README.md
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/LICENSE.md">
|
|
3
|
+
<img src="https://img.shields.io/github/license/Flow-Scanner/lightning-flow-scanner?style=flat-square" alt="License">
|
|
4
|
+
</a>
|
|
5
|
+
<a href="https://github.com/Flow-Scanner/lightning-flow-scanner/graphs/contributors">
|
|
6
|
+
<img src="https://img.shields.io/github/contributors/Flow-Scanner/lightning-flow-scanner.svg?style=flat-square" alt="Contributors">
|
|
7
|
+
</a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@flow-scanner/lightning-flow-scanner-core">
|
|
9
|
+
<img src="https://img.shields.io/npm/v/@flow-scanner/lightning-flow-scanner-core?label=core&style=flat-square" alt="Core version">
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/lightning-flow-scanner">
|
|
12
|
+
<img src="https://img.shields.io/npm/v/lightning-flow-scanner?label=cli&style=flat-square" alt="CLI version">
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://open-vsx.org/extension/ForceConfigControl/lightning-flow-scanner-vsx">
|
|
15
|
+
<img src="https://img.shields.io/open-vsx/v/ForceConfigControl/lightning-flow-scanner-vsx?label=Open%20VSX&style=flat-square" alt="Open VSX">
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://github.com/Flow-Scanner/lightning-flow-scanner/stargazers">
|
|
18
|
+
<img src="https://img.shields.io/github/stars/Flow-Scanner/lightning-flow-scanner?style=flat-square" alt="GitHub stars">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://www.npmjs.com/package/lightning-flow-scanner-core">
|
|
21
|
+
<img src="https://img.shields.io/badge/downloads-510k%2B-success?style=flat-square" alt="Total Downloads">
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
1
25
|
<p align="center">
|
|
2
26
|
<a href="https://github.com/Flow-Scanner">
|
|
3
|
-
<img src="assets/media/banner.png"
|
|
27
|
+
<img src="https://raw.githubusercontent.com/Flow-Scanner/Lightning-Flow-Scanner/main/assets/media/banner.png" alt="Lightning Flow Scanner" width="43%" />
|
|
4
28
|
</a>
|
|
5
29
|
</p>
|
|
6
30
|
|
|
@@ -10,34 +34,20 @@
|
|
|
10
34
|
|
|
11
35
|
## Table of contens
|
|
12
36
|
|
|
13
|
-
- **[Distributions](#distributions)**
|
|
14
37
|
- **[Default Rules](#default-rules)**
|
|
15
38
|
- **[Configuration](#configuration)**
|
|
16
39
|
- [Defining Severity Levels](#defining-severity-levels)
|
|
17
40
|
- [Configuring Expressions](#configuring-expressions)
|
|
18
41
|
- [Specifying Exceptions](#specifying-exceptions)
|
|
19
|
-
- [Report Detail Level](#report-detail-level)
|
|
20
42
|
- [Include Beta Rules](#include-beta-rules)
|
|
21
43
|
- **[Installation](#installation)**
|
|
22
|
-
- [
|
|
23
|
-
- [Core Module](#core-module)
|
|
44
|
+
- [Distributions](#distributions)
|
|
24
45
|
- [CICD Templates](#cicd-templates)
|
|
25
46
|
- **[Quick Start](#quick-start)**
|
|
26
47
|
- **[Development](#development)**
|
|
27
48
|
|
|
28
49
|
---
|
|
29
50
|
|
|
30
|
-
## Distributions
|
|
31
|
-
|
|
32
|
-
| Distribution | Best for | Install / Use |
|
|
33
|
-
|----------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
34
|
-
| **[Salesforce CLI Plugin](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/cli/README.md)** | Local development, scratch orgs, CI/CD | `sf plugins install lightning-flow-scanner` |
|
|
35
|
-
| **[VS Code Extension](https://github.com/Flow-Scanner/lightning-flow-scanner-vsx)** | Real-time scanning inside VS Code | `code --install-extension ForceConfigControl.lightning-flow-scanner-vsx` |
|
|
36
|
-
| **[Salesforce App (Managed Package)](https://github.com/Flow-Scanner/lightning-flow-scanner-app)** | Run scans directly inside a Salesforce org | `sf package install --package 04tgK0000007M73QAE` |
|
|
37
|
-
| **[Core Library](https://github.com/Flow-Scanner/lightning-flow-scanner/tree/main/packages/core)** (Node.js + Browser) | Custom tools, scripts, extensions, web apps | `npm install -g @flow-scanner/lightning-flow-scanner-core` |
|
|
38
|
-
|
|
39
|
-
**Privacy:** Zero user data collected. All processing is client-side. → See our [Security Policy](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=security-ov-file).
|
|
40
|
-
|
|
41
51
|
## Default Rules
|
|
42
52
|
|
|
43
53
|
<p>📌<strong>Tip:</strong> To link directly to a specific rule, use the full GitHub anchor link format. Example:</p>
|
|
@@ -248,34 +258,12 @@ _Example_
|
|
|
248
258
|
}
|
|
249
259
|
```
|
|
250
260
|
|
|
251
|
-
### Report Detail Level
|
|
252
|
-
|
|
253
|
-
Control the verbosity of violation reports via detailLevel. By default (`enriched`), outputs include element or flow-level details like variable data types, node connectors/locations, or attribute expressions for comprehensive reports. Set to `simple` for lighter output with only line and column numbers.
|
|
254
|
-
|
|
255
|
-
```json
|
|
256
|
-
{
|
|
257
|
-
"rules": {
|
|
258
|
-
...
|
|
259
|
-
},
|
|
260
|
-
"exceptions": {
|
|
261
|
-
...
|
|
262
|
-
},
|
|
263
|
-
"detailLevel": "simple"
|
|
264
|
-
}
|
|
265
|
-
```
|
|
266
|
-
|
|
267
261
|
### Include Beta Rules
|
|
268
262
|
|
|
269
263
|
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:
|
|
270
264
|
|
|
271
265
|
```json
|
|
272
266
|
{
|
|
273
|
-
"rules": {
|
|
274
|
-
...
|
|
275
|
-
},
|
|
276
|
-
"exceptions": {
|
|
277
|
-
...
|
|
278
|
-
},
|
|
279
267
|
"betaMode": true
|
|
280
268
|
}
|
|
281
269
|
|
|
@@ -283,29 +271,16 @@ New rules are introduced in Beta mode before being added to the default ruleset.
|
|
|
283
271
|
|
|
284
272
|
## Installation
|
|
285
273
|
|
|
286
|
-
|
|
287
|
-
[](https://gitHub.com/Flow-Scanner/lightning-flow-scanner/graphs/contributors/)
|
|
288
|
-
[](github.com/Flow-Scanner/lightning-flow-scanner/raw/main/LICENSE.md)
|
|
289
|
-
|
|
290
|
-
### Salesforce CLI Plugin
|
|
291
|
-
[](https://www.npmjs.com/package/lightning-flow-scanner)
|
|
274
|
+
### Distributions
|
|
292
275
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
npm install -g lightning-flow-scanner
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
### Core Module
|
|
302
|
-
[](https://www.npmjs.com/package/@flow-scanner/lightning-flow-scanner-core)
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
|
-
npm install -g @flow-scanner/lightning-flow-scanner-core
|
|
306
|
-
```
|
|
276
|
+
| Distribution | Best for | Install / Use |
|
|
277
|
+
|----------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
278
|
+
| **[Salesforce CLI Plugin](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/cli/README.md)** | Local development, scratch orgs, CI/CD | `sf plugins install lightning-flow-scanner` |
|
|
279
|
+
| **[VS Code Extension](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/vsx/README.md)** | Real-time scanning inside VS Code | `code --install-extension ForceConfigControl.lightning-flow-scanner-vsx` |
|
|
280
|
+
| **[Salesforce App (Managed Package)](https://github.com/Flow-Scanner/lightning-flow-scanner-app)** | Run scans directly inside a Salesforce org | `sf package install --package 04tgK0000007M73QAE` |
|
|
281
|
+
| **[Core Library](https://github.com/Flow-Scanner/lightning-flow-scanner/tree/main/packages/core)** (Node.js + Browser) | Custom tools, scripts, extensions, web apps | `npm install -g @flow-scanner/lightning-flow-scanner-core` |
|
|
307
282
|
|
|
308
|
-
|
|
283
|
+
**Privacy:** Zero user data collected. All processing is client-side. → See our [Security Policy](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=security-ov-file).
|
|
309
284
|
|
|
310
285
|
### CICD Templates
|
|
311
286
|
Ready-to-use CI/CD templates and a **native GitHub Action**.
|
|
@@ -344,6 +319,14 @@ sf flow:fix -d src/force-app
|
|
|
344
319
|
sf flow:scan --sarif > report.sarif
|
|
345
320
|
```
|
|
346
321
|
|
|
322
|
+
### VS Code Extension
|
|
323
|
+
Use our side bar or the **Command Palette** and type `flowscanner` to see all available commands:
|
|
324
|
+
|
|
325
|
+
* `Configure Flow Scanner` - Set up rules in `.flow-scanner.yml`
|
|
326
|
+
* `Scan Flows` - Analyze a directory or selected flow files
|
|
327
|
+
* `Fix Flows` - Automatically apply available fixes
|
|
328
|
+
* `Flow Scanner Documentation` - Open the rules reference guide
|
|
329
|
+
|
|
347
330
|
### Core Module
|
|
348
331
|
Use `lightning-flow-scanner-core` as a Node.js/browser dependency:
|
|
349
332
|
|
package/SECURITY.md
CHANGED
|
@@ -42,3 +42,13 @@ We actively track and maintain an up-to-date inventory of all third-party depend
|
|
|
42
42
|
| `@actions/core` | [MIT](https://github.com/actions/toolkit/blob/main/packages/core/LICENSE) | Toolkit for developing GitHub Actions |
|
|
43
43
|
| `@actions/github` | [MIT](https://github.com/actions/toolkit/blob/main/packages/github/LICENSE) | Interact with the GitHub API in Actions |
|
|
44
44
|
| `cosmiconfig` | [MIT](https://github.com/davidtheclark/cosmiconfig/blob/main/LICENSE) | Config file loader for JavaScript/Node |
|
|
45
|
+
|
|
46
|
+
### VSX
|
|
47
|
+
|
|
48
|
+
| Package | License | Purpose` |
|
|
49
|
+
| ------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------- |
|
|
50
|
+
| `convert-array-to-csv` | [MIT](https://github.com/zemirco/convert-array-to-csv/blob/master/LICENSE) | Converts JavaScript arrays into CSV format |
|
|
51
|
+
| `tabulator-tables` | [MIT](https://github.com/olifolkerd/tabulator/blob/master/LICENSE) | Interactive tables and data grids for web apps |
|
|
52
|
+
| `uuid` | [MIT](https://github.com/uuidjs/uuid/blob/main/LICENSE.md) | Generates RFC-compliant UUIDs |
|
|
53
|
+
| `cosmiconfig` | [MIT](https://github.com/davidtheclark/cosmiconfig/blob/main/LICENSE) | Config file loader for JavaScript/Node |
|
|
54
|
+
| `glob` | [MIT](https://github.com/isaacs/node-glob/blob/master/LICENSE) | File pattern matching |
|
|
@@ -14,5 +14,5 @@ import { RuleCommon } from "../models/RuleCommon";
|
|
|
14
14
|
import { RuleResult } from "../models/RuleResult";
|
|
15
15
|
import { ScanResult } from "../models/ScanResult";
|
|
16
16
|
import { Violation } from "../models/Violation";
|
|
17
|
-
export {
|
|
18
|
-
export type { IRuleDefinition, IRulesConfig };
|
|
17
|
+
export { FlowAttribute, FlowElement, FlowNode, FlowType, FlowVariable, FlowResource, Flow, Compiler, ScanResult, RuleResult, Violation, RuleCommon, ParsedFlow, };
|
|
18
|
+
export type { IRuleDefinition, IRulesConfig, FlatViolation };
|
|
@@ -12,9 +12,6 @@ _export(exports, {
|
|
|
12
12
|
get Compiler () {
|
|
13
13
|
return _Compiler.Compiler;
|
|
14
14
|
},
|
|
15
|
-
get FlatViolation () {
|
|
16
|
-
return _FlatViolation.FlatViolation;
|
|
17
|
-
},
|
|
18
15
|
get Flow () {
|
|
19
16
|
return _Flow.Flow;
|
|
20
17
|
},
|
|
@@ -53,7 +50,6 @@ _export(exports, {
|
|
|
53
50
|
}
|
|
54
51
|
});
|
|
55
52
|
const _Compiler = require("../libs/Compiler");
|
|
56
|
-
const _FlatViolation = require("../models/FlatViolation");
|
|
57
53
|
const _Flow = require("../models/Flow");
|
|
58
54
|
const _FlowAttribute = require("../models/FlowAttribute");
|
|
59
55
|
const _FlowElement = require("../models/FlowElement");
|
|
@@ -86,10 +86,9 @@ let RuleCommon = class RuleCommon {
|
|
|
86
86
|
return suppressions.has(name);
|
|
87
87
|
}
|
|
88
88
|
constructor(info, optional){
|
|
89
|
-
_define_property(this, "autoFixable", void 0);
|
|
90
89
|
_define_property(this, "description", void 0);
|
|
91
90
|
_define_property(this, "docRefs", []);
|
|
92
|
-
_define_property(this, "isConfigurable", void 0);
|
|
91
|
+
_define_property(this, "isConfigurable", void 0); // Auto-detected by checking if the implemented check() method actually uses "options."
|
|
93
92
|
_define_property(this, "label", void 0);
|
|
94
93
|
_define_property(this, "name", void 0);
|
|
95
94
|
_define_property(this, "severity", void 0);
|
|
@@ -102,8 +101,13 @@ let RuleCommon = class RuleCommon {
|
|
|
102
101
|
this.description = info.description;
|
|
103
102
|
this.uri = `https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/main/src/main/rules/${info.name}.ts`;
|
|
104
103
|
this.docRefs = info.docRefs;
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
const checkImpl = this.check;
|
|
105
|
+
if (typeof checkImpl === "function") {
|
|
106
|
+
const source = checkImpl.toString();
|
|
107
|
+
this.isConfigurable = /options[.\?]/.test(source);
|
|
108
|
+
} else {
|
|
109
|
+
this.isConfigurable = false;
|
|
110
|
+
}
|
|
107
111
|
var _optional_severity;
|
|
108
112
|
this.severity = (_optional_severity = optional === null || optional === void 0 ? void 0 : optional.severity) !== null && _optional_severity !== void 0 ? _optional_severity : "error";
|
|
109
113
|
this.suppressionElement = info.suppressionElement;
|
|
@@ -7,11 +7,6 @@ export type RuleDefinitionExpression = {
|
|
|
7
7
|
* Represents a rule metadata; this contains properties to describe the rule
|
|
8
8
|
*/
|
|
9
9
|
export declare class RuleInfo {
|
|
10
|
-
/**
|
|
11
|
-
* Indicates whether the rule can be automatically fixed.
|
|
12
|
-
* When the rule is autofixable, implement @see {AutoFixable}
|
|
13
|
-
*/
|
|
14
|
-
autoFixable: boolean;
|
|
15
10
|
/**
|
|
16
11
|
* A human-readable description of the rule.
|
|
17
12
|
*/
|
|
@@ -23,16 +18,6 @@ export declare class RuleInfo {
|
|
|
23
18
|
label: string;
|
|
24
19
|
path: string;
|
|
25
20
|
}>;
|
|
26
|
-
/**
|
|
27
|
-
* Specifies if the rule's behavior can be configured.
|
|
28
|
-
* When configurable, execute should take in a second parameter @see RuleDefinitionExpression
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* public execute(flow: core.Flow, options?: { expression: string }): core.RuleResult {
|
|
32
|
-
* // your rule
|
|
33
|
-
* }
|
|
34
|
-
*/
|
|
35
|
-
isConfigurable: boolean;
|
|
36
21
|
/**
|
|
37
22
|
* The display label for the rule.
|
|
38
23
|
* This property is being displayed on sf cli and on vsce
|
package/main/models/RuleInfo.js
CHANGED
|
@@ -24,25 +24,12 @@ function _define_property(obj, key, value) {
|
|
|
24
24
|
let RuleInfo = class RuleInfo {
|
|
25
25
|
constructor(){
|
|
26
26
|
/**
|
|
27
|
-
* Indicates whether the rule can be automatically fixed.
|
|
28
|
-
* When the rule is autofixable, implement @see {AutoFixable}
|
|
29
|
-
*/ _define_property(this, "autoFixable", void 0);
|
|
30
|
-
/**
|
|
31
27
|
* A human-readable description of the rule.
|
|
32
28
|
*/ _define_property(this, "description", void 0);
|
|
33
29
|
/**
|
|
34
30
|
* An array of documentation references related to the rule.
|
|
35
31
|
*/ _define_property(this, "docRefs", void 0);
|
|
36
32
|
/**
|
|
37
|
-
* Specifies if the rule's behavior can be configured.
|
|
38
|
-
* When configurable, execute should take in a second parameter @see RuleDefinitionExpression
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* public execute(flow: core.Flow, options?: { expression: string }): core.RuleResult {
|
|
42
|
-
* // your rule
|
|
43
|
-
* }
|
|
44
|
-
*/ _define_property(this, "isConfigurable", void 0);
|
|
45
|
-
/**
|
|
46
33
|
* The display label for the rule.
|
|
47
34
|
* This property is being displayed on sf cli and on vsce
|
|
48
35
|
*/ _define_property(this, "label", void 0);
|
package/main/rules/APIVersion.js
CHANGED
|
@@ -80,9 +80,7 @@ let APIVersion = class APIVersion extends _RuleCommon.RuleCommon {
|
|
|
80
80
|
label: "Outdated API Version",
|
|
81
81
|
description: "Introducing newer API components may lead to unexpected issues with older versions of Flows, as they might not align with the underlying mechanics. Starting from API version 50.0, the 'Api Version' attribute has been readily available on the Flow Object. To ensure smooth operation and reduce discrepancies between API versions, it is strongly advised to regularly update and maintain them.",
|
|
82
82
|
supportedTypes: _internals.FlowType.allTypes(),
|
|
83
|
-
docRefs: []
|
|
84
|
-
isConfigurable: true,
|
|
85
|
-
autoFixable: false
|
|
83
|
+
docRefs: []
|
|
86
84
|
});
|
|
87
85
|
}
|
|
88
86
|
};
|
|
@@ -19,7 +19,6 @@ let ActionCallsInLoop = class ActionCallsInLoop extends _LoopRuleCommon.LoopRule
|
|
|
19
19
|
}
|
|
20
20
|
constructor(){
|
|
21
21
|
super({
|
|
22
|
-
autoFixable: false,
|
|
23
22
|
description: "To prevent exceeding Apex governor limits, it is advisable to consolidate and bulkify your apex calls, utilize a single action call containing a collection variable at the end of the loop.",
|
|
24
23
|
docRefs: [
|
|
25
24
|
{
|
|
@@ -27,7 +26,6 @@ let ActionCallsInLoop = class ActionCallsInLoop extends _LoopRuleCommon.LoopRule
|
|
|
27
26
|
path: "https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm"
|
|
28
27
|
}
|
|
29
28
|
],
|
|
30
|
-
isConfigurable: false,
|
|
31
29
|
label: "Action Call In Loop",
|
|
32
30
|
name: "ActionCallsInLoop",
|
|
33
31
|
supportedTypes: _internals.FlowType.backEndTypes
|
package/main/rules/AutoLayout.js
CHANGED
|
@@ -69,9 +69,7 @@ let AutoLayout = class AutoLayout extends _RuleCommon.RuleCommon {
|
|
|
69
69
|
label: "Auto-Layout Mode",
|
|
70
70
|
description: "With Canvas Mode set to Auto-Layout, Elements are spaced, connected, and aligned automatically, keeping your Flow neatly organized thus saving you time.",
|
|
71
71
|
supportedTypes: _internals.FlowType.allTypes(),
|
|
72
|
-
docRefs: []
|
|
73
|
-
isConfigurable: true,
|
|
74
|
-
autoFixable: false
|
|
72
|
+
docRefs: []
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
75
|
};
|
|
@@ -63,9 +63,7 @@ let CopyAPIName = class CopyAPIName extends _RuleCommon.RuleCommon {
|
|
|
63
63
|
label: "Copy API Name",
|
|
64
64
|
description: "Maintaining multiple elements with a similar name, like 'Copy_X_Of_Element,' can diminish the overall readability of your Flow. When copying and pasting these elements, it's crucial to remember to update the API name of the newly created copy.",
|
|
65
65
|
supportedTypes: _internals.FlowType.allTypes(),
|
|
66
|
-
docRefs: []
|
|
67
|
-
isConfigurable: false,
|
|
68
|
-
autoFixable: false
|
|
66
|
+
docRefs: []
|
|
69
67
|
});
|
|
70
68
|
}
|
|
71
69
|
};
|
|
@@ -96,9 +96,7 @@ let CyclomaticComplexity = class CyclomaticComplexity extends _RuleCommon.RuleCo
|
|
|
96
96
|
label: `Cyclomatic complexity is a software metric used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code.`,
|
|
97
97
|
path: "https://en.wikipedia.org/wiki/Cyclomatic_complexity"
|
|
98
98
|
}
|
|
99
|
-
]
|
|
100
|
-
isConfigurable: true,
|
|
101
|
-
autoFixable: false
|
|
99
|
+
]
|
|
102
100
|
}, {
|
|
103
101
|
severity: "note"
|
|
104
102
|
}), _define_property(this, "defaultThreshold", 25), _define_property(this, "cyclomaticComplexityUnit", 0);
|
|
@@ -20,7 +20,6 @@ let DMLStatementInLoop = class DMLStatementInLoop extends _LoopRuleCommon.LoopRu
|
|
|
20
20
|
}
|
|
21
21
|
constructor(){
|
|
22
22
|
super({
|
|
23
|
-
autoFixable: false,
|
|
24
23
|
description: "To prevent exceeding Apex governor limits, it is advisable to consolidate all your database operations, including record creation, updates, or deletions, at the conclusion of the flow.",
|
|
25
24
|
docRefs: [
|
|
26
25
|
{
|
|
@@ -28,7 +27,6 @@ let DMLStatementInLoop = class DMLStatementInLoop extends _LoopRuleCommon.LoopRu
|
|
|
28
27
|
path: "https://help.salesforce.com/s/articleView?id=sf.flow_prep_bestpractices.htm&type=5"
|
|
29
28
|
}
|
|
30
29
|
],
|
|
31
|
-
isConfigurable: false,
|
|
32
30
|
label: "DML Statement In A Loop",
|
|
33
31
|
name: "DMLStatementInLoop",
|
|
34
32
|
supportedTypes: _internals.FlowType.backEndTypes
|
|
@@ -136,9 +136,7 @@ let DuplicateDMLOperation = class DuplicateDMLOperation extends _RuleCommon.Rule
|
|
|
136
136
|
label: "Duplicate DML Operation",
|
|
137
137
|
description: "When the flow executes database changes or actions between two screens, it's important to prevent users from navigating back between screens. Failure to do so may result in duplicate database operations being performed within the flow.",
|
|
138
138
|
supportedTypes: _internals.FlowType.visualTypes,
|
|
139
|
-
docRefs: []
|
|
140
|
-
isConfigurable: false,
|
|
141
|
-
autoFixable: false
|
|
139
|
+
docRefs: []
|
|
142
140
|
});
|
|
143
141
|
}
|
|
144
142
|
};
|
|
@@ -63,10 +63,8 @@ let FlowDescription = class FlowDescription extends _RuleCommon.RuleCommon {
|
|
|
63
63
|
}
|
|
64
64
|
constructor(){
|
|
65
65
|
super({
|
|
66
|
-
autoFixable: false,
|
|
67
66
|
description: "Descriptions play a vital role in documentation. We highly recommend including details about where they are used and their intended purpose.",
|
|
68
67
|
docRefs: [],
|
|
69
|
-
isConfigurable: false,
|
|
70
68
|
label: "Missing Flow Description",
|
|
71
69
|
name: "FlowDescription",
|
|
72
70
|
supportedTypes: [
|
package/main/rules/FlowName.js
CHANGED
|
@@ -66,7 +66,6 @@ let FlowName = class FlowName extends _RuleCommon.RuleCommon {
|
|
|
66
66
|
}
|
|
67
67
|
constructor(){
|
|
68
68
|
super({
|
|
69
|
-
autoFixable: false,
|
|
70
69
|
description: "The readability of a flow is of utmost importance. Establishing a naming convention for the Flow Name significantly enhances findability, searchability, and maintains overall consistency. It is advisable to include at least a domain and a brief description of the actions carried out in the flow, for instance, 'Service_OrderFulfillment'.",
|
|
71
70
|
docRefs: [
|
|
72
71
|
{
|
|
@@ -74,7 +73,6 @@ let FlowName = class FlowName extends _RuleCommon.RuleCommon {
|
|
|
74
73
|
path: "https://www.linkedin.com/posts/stephen-n-church_naming-your-flows-this-is-more-critical-activity-7099733198175158274-1sPx"
|
|
75
74
|
}
|
|
76
75
|
],
|
|
77
|
-
isConfigurable: true,
|
|
78
76
|
label: "Flow Naming Convention",
|
|
79
77
|
name: "FlowName",
|
|
80
78
|
supportedTypes: _internals.FlowType.allTypes()
|
|
@@ -66,7 +66,6 @@ let GetRecordAllFields = class GetRecordAllFields extends _RuleCommon.RuleCommon
|
|
|
66
66
|
}
|
|
67
67
|
constructor(){
|
|
68
68
|
super({
|
|
69
|
-
autoFixable: false,
|
|
70
69
|
description: "Following the principle of least privilege (PoLP), avoid using Get Records with 'Automatically store all fields' unless necessary.",
|
|
71
70
|
docRefs: [
|
|
72
71
|
{
|
|
@@ -78,7 +77,6 @@ let GetRecordAllFields = class GetRecordAllFields extends _RuleCommon.RuleCommon
|
|
|
78
77
|
path: "https://developer.salesforce.com/docs/atlas.en-us.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_infrastructure_indexes.htm"
|
|
79
78
|
}
|
|
80
79
|
],
|
|
81
|
-
isConfigurable: false,
|
|
82
80
|
label: "Get Record All Fields",
|
|
83
81
|
name: "GetRecordAllFields",
|
|
84
82
|
supportedTypes: _internals.FlowType.allTypes()
|
|
@@ -71,9 +71,7 @@ let HardcodedId = class HardcodedId extends _RuleCommon.RuleCommon {
|
|
|
71
71
|
label: "Don't hard code Record Type IDs in Flow. By Stephen Church.",
|
|
72
72
|
path: "https://www.linkedin.com/feed/update/urn:li:activity:6947530300012826624/"
|
|
73
73
|
}
|
|
74
|
-
]
|
|
75
|
-
isConfigurable: false,
|
|
76
|
-
autoFixable: false
|
|
74
|
+
]
|
|
77
75
|
});
|
|
78
76
|
}
|
|
79
77
|
};
|
|
@@ -18,7 +18,6 @@ let HardcodedUrl = class HardcodedUrl extends _RuleCommon.RuleCommon {
|
|
|
18
18
|
}
|
|
19
19
|
constructor(){
|
|
20
20
|
super({
|
|
21
|
-
autoFixable: false,
|
|
22
21
|
description: "Avoid hard-coding URLs as they are org-specific. Instead, use a $API formula (preferred) or you can use an environment-specific such as custom labels, custom metadata, or custom settings.",
|
|
23
22
|
docRefs: [
|
|
24
23
|
{
|
|
@@ -30,7 +29,6 @@ let HardcodedUrl = class HardcodedUrl extends _RuleCommon.RuleCommon {
|
|
|
30
29
|
path: "https://admin.salesforce.com/blog/2021/why-you-should-avoid-hard-coding-and-three-alternative-solutions"
|
|
31
30
|
}
|
|
32
31
|
],
|
|
33
|
-
isConfigurable: false,
|
|
34
32
|
label: "Hardcoded Url",
|
|
35
33
|
name: "HardcodedUrl",
|
|
36
34
|
supportedTypes: _internals.FlowType.allTypes()
|
|
@@ -66,9 +66,7 @@ let InactiveFlow = class InactiveFlow extends _RuleCommon.RuleCommon {
|
|
|
66
66
|
label: "Inactive Flow",
|
|
67
67
|
description: "Like cleaning out your closet: deleting unused flows is essential. Inactive flows can still cause trouble, like accidentally deleting records during testing, or being activated as subflows within parent flows.",
|
|
68
68
|
supportedTypes: _internals.FlowType.allTypes(),
|
|
69
|
-
docRefs: []
|
|
70
|
-
isConfigurable: false,
|
|
71
|
-
autoFixable: false
|
|
69
|
+
docRefs: []
|
|
72
70
|
});
|
|
73
71
|
}
|
|
74
72
|
};
|
|
@@ -120,7 +120,6 @@ let MissingFaultPath = class MissingFaultPath extends _RuleCommon.RuleCommon {
|
|
|
120
120
|
}
|
|
121
121
|
constructor(){
|
|
122
122
|
super({
|
|
123
|
-
autoFixable: false,
|
|
124
123
|
description: "At times, a flow may fail to execute a configured operation as intended. By default, the flow displays an error message to the user and notifies the admin who created the flow via email. However, you can customize this behavior by incorporating a Fault Path.",
|
|
125
124
|
docRefs: [
|
|
126
125
|
{
|
|
@@ -128,7 +127,6 @@ let MissingFaultPath = class MissingFaultPath extends _RuleCommon.RuleCommon {
|
|
|
128
127
|
path: "https://help.salesforce.com/s/articleView?id=sf.flow_prep_bestpractices.htm&type=5"
|
|
129
128
|
}
|
|
130
129
|
],
|
|
131
|
-
isConfigurable: false,
|
|
132
130
|
label: "Missing Fault Path",
|
|
133
131
|
name: "MissingFaultPath",
|
|
134
132
|
supportedTypes: [
|
|
@@ -65,10 +65,8 @@ let MissingMetadataDescription = class MissingMetadataDescription extends _RuleC
|
|
|
65
65
|
}
|
|
66
66
|
constructor(){
|
|
67
67
|
super({
|
|
68
|
-
autoFixable: false,
|
|
69
68
|
description: "Every element must have a meaningful description",
|
|
70
69
|
docRefs: [],
|
|
71
|
-
isConfigurable: false,
|
|
72
70
|
label: "Missing Metadata Description",
|
|
73
71
|
name: "MissingMetadataDescription",
|
|
74
72
|
supportedTypes: _internals.FlowType.allTypes()
|
|
@@ -130,10 +130,8 @@ let MissingNullHandler = class MissingNullHandler extends _RuleCommon.RuleCommon
|
|
|
130
130
|
}
|
|
131
131
|
constructor(){
|
|
132
132
|
super({
|
|
133
|
-
autoFixable: false,
|
|
134
133
|
description: "When a Get Records operation doesn't find any data, it returns null. To ensure data validation, utilize a decision element on the operation result variable to check for a non-null result.",
|
|
135
134
|
docRefs: [],
|
|
136
|
-
isConfigurable: false,
|
|
137
135
|
label: "Missing Null Handler",
|
|
138
136
|
name: "MissingNullHandler",
|
|
139
137
|
supportedTypes: [
|
|
@@ -68,9 +68,7 @@ let ProcessBuilder = class ProcessBuilder extends _RuleCommon.RuleCommon {
|
|
|
68
68
|
label: "Process Builder Retirement",
|
|
69
69
|
path: "https://help.salesforce.com/s/articleView?id=000389396&type=1"
|
|
70
70
|
}
|
|
71
|
-
]
|
|
72
|
-
isConfigurable: true,
|
|
73
|
-
autoFixable: false
|
|
71
|
+
]
|
|
74
72
|
});
|
|
75
73
|
}
|
|
76
74
|
};
|
|
@@ -101,7 +101,6 @@ let RecursiveAfterUpdate = class RecursiveAfterUpdate extends _RuleCommon.RuleCo
|
|
|
101
101
|
}
|
|
102
102
|
constructor(){
|
|
103
103
|
super({
|
|
104
|
-
autoFixable: false,
|
|
105
104
|
description: "After updates are meant to be used for record modifications that are not the same record that triggered the flow. Using after updates on the same record can lead to recursion and unexpected behavior. Consider using before save flows for same record updates.",
|
|
106
105
|
docRefs: [
|
|
107
106
|
{
|
|
@@ -109,7 +108,6 @@ let RecursiveAfterUpdate = class RecursiveAfterUpdate extends _RuleCommon.RuleCo
|
|
|
109
108
|
path: "https://architect.salesforce.com/decision-guides/trigger-automation#Same_Record_Field_Updates"
|
|
110
109
|
}
|
|
111
110
|
],
|
|
112
|
-
isConfigurable: false,
|
|
113
111
|
label: "Recursive After Update",
|
|
114
112
|
name: "RecursiveAfterUpdate",
|
|
115
113
|
supportedTypes: [
|
|
@@ -18,7 +18,6 @@ let SOQLQueryInLoop = class SOQLQueryInLoop extends _LoopRuleCommon.LoopRuleComm
|
|
|
18
18
|
}
|
|
19
19
|
constructor(){
|
|
20
20
|
super({
|
|
21
|
-
autoFixable: false,
|
|
22
21
|
description: "To prevent exceeding Apex governor limits, it is advisable to consolidate all your SOQL queries at the conclusion of the flow.",
|
|
23
22
|
docRefs: [
|
|
24
23
|
{
|
|
@@ -26,7 +25,6 @@ let SOQLQueryInLoop = class SOQLQueryInLoop extends _LoopRuleCommon.LoopRuleComm
|
|
|
26
25
|
path: "https://help.salesforce.com/s/articleView?id=sf.flow_prep_bestpractices.htm&type=5"
|
|
27
26
|
}
|
|
28
27
|
],
|
|
29
|
-
isConfigurable: false,
|
|
30
28
|
label: "SOQL Query In A Loop",
|
|
31
29
|
name: "SOQLQueryInLoop",
|
|
32
30
|
supportedTypes: _internals.FlowType.backEndTypes
|
|
@@ -95,9 +95,7 @@ let SameRecordFieldUpdates = class SameRecordFieldUpdates extends _RuleCommon.Ru
|
|
|
95
95
|
label: "Learn about same record field updates",
|
|
96
96
|
path: "https://architect.salesforce.com/decision-guides/trigger-automation#Same_Record_Field_Updates"
|
|
97
97
|
}
|
|
98
|
-
]
|
|
99
|
-
isConfigurable: false,
|
|
100
|
-
autoFixable: false
|
|
98
|
+
]
|
|
101
99
|
}, {
|
|
102
100
|
severity: "warning"
|
|
103
101
|
}), _define_property(this, "qualifiedRecordTriggerTypes", new Set([
|
|
@@ -87,9 +87,7 @@ let TriggerOrder = class TriggerOrder extends _RuleCommon.RuleCommon {
|
|
|
87
87
|
label: "Learn more about flow ordering orchestration",
|
|
88
88
|
path: "https://architect.salesforce.com/decision-guides/trigger-automation#Ordering___Orchestration"
|
|
89
89
|
}
|
|
90
|
-
]
|
|
91
|
-
isConfigurable: false,
|
|
92
|
-
autoFixable: false
|
|
90
|
+
]
|
|
93
91
|
}, {
|
|
94
92
|
severity: "note"
|
|
95
93
|
}), _define_property(this, "qualifiedRecordTriggerTypes", new Set([
|
|
@@ -72,10 +72,8 @@ let UnconnectedElement = class UnconnectedElement extends _RuleCommon.RuleCommon
|
|
|
72
72
|
}
|
|
73
73
|
constructor(){
|
|
74
74
|
super({
|
|
75
|
-
autoFixable: true,
|
|
76
75
|
description: "To maintain the efficiency and manageability of your Flow, it's best to avoid including unconnected elements that are not in use.",
|
|
77
76
|
docRefs: [],
|
|
78
|
-
isConfigurable: false,
|
|
79
77
|
label: "Unconnected Element",
|
|
80
78
|
name: "UnconnectedElement",
|
|
81
79
|
supportedTypes: [
|
|
@@ -79,9 +79,7 @@ let UnsafeRunningContext = class UnsafeRunningContext extends _RuleCommon.RuleCo
|
|
|
79
79
|
label: "Learn about data safety when running flows in system context in Salesforce Help",
|
|
80
80
|
path: "https://help.salesforce.com/s/articleView?id=sf.flow_distribute_context_data_safety_system_context.htm&type=5"
|
|
81
81
|
}
|
|
82
|
-
]
|
|
83
|
-
isConfigurable: false,
|
|
84
|
-
autoFixable: false
|
|
82
|
+
]
|
|
85
83
|
}, {
|
|
86
84
|
severity: "warning"
|
|
87
85
|
});
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
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.6.
|
|
4
|
+
"version": "6.6.5",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
6
|
"exports": {
|
|
8
7
|
".": {
|
|
9
8
|
"import": "./index.js",
|
|
@@ -39,5 +38,6 @@
|
|
|
39
38
|
"salesforce",
|
|
40
39
|
"security-scanner",
|
|
41
40
|
"static-analysis"
|
|
42
|
-
]
|
|
41
|
+
],
|
|
42
|
+
"types": "index.d.ts"
|
|
43
43
|
}
|