Skip to content

Commit dfbe287

Browse files
authored
Merge pull request #82 from Lightning-Flow-Scanner/update
Update
2 parents aa80287 + 17e9804 commit dfbe287

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,18 @@ sfdx flow:scan --config path/to/.flow-scanner.json
8080
```
8181

8282
## Rule overview
83-
8483
| Rule | Description |
8584
|--------------|:-----------|
8685
| **Outdated API Version** | 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. |
8786
| **Copy API Name** | 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. |
88-
| **DML Statement In A Loop** | To prevent exceeding Apex governor limits, it is advisable to consolidate all your record-related operations, including creation, updates, or deletions, at the conclusion of the flow. |
87+
| **DML Statement In A Loop** | 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. |
8988
| **Duplicate DML Operation** | 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. |
9089
| **Hardcoded Id** | Avoid hard-coding IDs as they are org-specific. Instead, pass them into variables at the start of the flow. You can achieve this by utilizing merge fields in URL parameters or employing a Get Records element. |
9190
| **Flow Naming Convention** | 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'. |
9291
| **Missing Flow Description** | Descriptions play a vital role in documentation. We highly recommend including details about where they are used and their intended purpose. |
9392
| **Missing Fault Path** | 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. |
9493
| **Missing Null Handler** | 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. |
94+
| **SOQL Query In A Loop** | To prevent exceeding Apex governor limits, it is advisable to consolidate all your SOQL queries at the conclusion of the flow. |
9595
| **Unconnected Element** | Unconnected elements which are not being used by the Flow should be avoided to keep Flows efficient and maintainable. |
9696
| **Unused Variable** | To maintain the efficiency and manageability of your Flow, it's advisable to avoid including unconnected variables that are not in use. |
9797

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lightning-flow-scanner",
3-
"version": "2.15.0",
3+
"version": "2.16.0",
44
"author": "Ruben",
55
"bugs": "https://github.com/Force-Config-Control/lightning-flow-scanner-sfdx/issues",
66
"dependencies": {
@@ -13,7 +13,7 @@
1313
"cosmiconfig": "^8.1.3",
1414
"fs-extra": "^11.1.1",
1515
"glob": "^7.1.7",
16-
"lightning-flow-scanner-core": "2.25",
16+
"lightning-flow-scanner-core": "2.26",
1717
"tslib": "^1",
1818
"xml2js": "^0.4.23"
1919
},

src/commands/flow/scan.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,18 @@ export default class scan extends SfdxCommand {
160160
status = 0;
161161
}
162162
else {
163-
if (this.failOn === "error" && (this.errorCounters["error"] || 0) > 0) {
163+
if (this.failOn === "error" && this.errorCounters["error"] > 0) {
164164
status = 1;
165165
}
166-
else if (this.failOn === 'warning' &&
167-
((this.errorCounters["error"] || 0) > 0)
168-
|| ((this.errorCounters["warning"] || 0) > 0)) {
166+
else if (this.failOn === 'warning' && (
167+
this.errorCounters["error"] > 0
168+
|| this.errorCounters["warning"] > 0)) {
169169
status = 1;
170170
}
171171
else if (this.failOn === 'note' &&
172-
((this.errorCounters["error"] || 0) > 0)
173-
|| ((this.errorCounters["warning"] || 0) > 0)
174-
|| ((this.errorCounters["note"] || 0) > 0)) {
172+
(this.errorCounters["error"] > 0
173+
|| this.errorCounters["warning"] > 0
174+
|| this.errorCounters["note"] > 0)) {
175175
status = 1;
176176
}
177177
}

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,9 @@
458458
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.19.tgz#80f286b515897413c7a35bdda069cc80f2344233"
459459

460460
"@types/chai@^4.2.21":
461-
version "4.3.10"
462-
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.10.tgz#2ad2959d1767edee5b0e4efb1a0cd2b500747317"
463-
integrity sha512-of+ICnbqjmFCiixUnqRulbylyXQrPqIGf/B3Jax1wIF3DvSheysQxAWvqHhZiW3IQrycvokcLcFQlveGp+vyNg==
461+
version "4.3.11"
462+
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.11.tgz#e95050bf79a932cb7305dd130254ccdf9bde671c"
463+
integrity sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==
464464

465465
"@types/glob@^7.1.1":
466466
version "7.1.3"
@@ -508,9 +508,9 @@
508508
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.0.0.tgz#067a6c49dc7a5c2412a505628e26902ae967bf6f"
509509

510510
"@types/node@^20.4.5":
511-
version "20.9.0"
512-
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298"
513-
integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==
511+
version "20.10.0"
512+
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.0.tgz#16ddf9c0a72b832ec4fcce35b8249cf149214617"
513+
integrity sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==
514514
dependencies:
515515
undici-types "~5.26.4"
516516

@@ -2638,10 +2638,10 @@ levn@^0.4.1:
26382638
prelude-ls "^1.2.1"
26392639
type-check "~0.4.0"
26402640

2641-
lightning-flow-scanner-core@2.25:
2642-
version "2.25.0"
2643-
resolved "https://registry.yarnpkg.com/lightning-flow-scanner-core/-/lightning-flow-scanner-core-2.25.0.tgz#3c11b8e04d5fe3c287fe1310124f38da0768bf30"
2644-
integrity sha512-AktlapWeh9uNaa1BoeBfJ54uGWpPnGWa6z+q8fQumsQHx5xr0bdPpR/B+29RuPC6BxccTUxen4L747n3dMRRAg==
2641+
lightning-flow-scanner-core@2.26:
2642+
version "2.26.0"
2643+
resolved "https://registry.yarnpkg.com/lightning-flow-scanner-core/-/lightning-flow-scanner-core-2.26.0.tgz#3b65def0fed760b17cad807e38e71bb4f94b03e5"
2644+
integrity sha512-daojvhKd5QdmQiu/gVCvsXFA2bVvtR8kHfUkTTFjSrDo8LA8VX//Fdk2CuUZxY5U1Z1MF9v+7cjal01N5hiaBg==
26452645
dependencies:
26462646
"@types/chai" "^4.2.21"
26472647
"@types/node" "^20.4.5"

0 commit comments

Comments
 (0)