New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lightning-flow-scanner-core

Package Overview
Dependencies
Maintainers
1
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightning-flow-scanner-core - npm Package Compare versions

Comparing version 1.0.17 to 1.0.18

45

out/main/rules/DMLStatementInLoop.js

@@ -23,28 +23,29 @@ "use strict";

indexesToProcess = indexesToProcess.filter(index => !processedLoopElementIndexes.includes(index));
if (indexesToProcess.length > 0) {
for (const [index, element] of flowElements.entries()) {
if (indexesToProcess.includes(index)) {
const connectors = [];
for (const connector of element.connectors) {
if (connector.reference) {
connectors.push(connector);
}
if (indexesToProcess.length <= 0 || (indexesToProcess.length == 1 && indexesToProcess[0] == -1)) {
break;
}
for (const [index, element] of flowElements.entries()) {
if (indexesToProcess.includes(index)) {
const connectors = [];
for (const connector of element.connectors) {
if (connector.reference) {
connectors.push(connector);
}
if (dmlStatementTypes.includes(element.subtype)) {
dmlInLoopIndexes.push(index);
}
if (connectors.length > 0) {
const elementsByReferences = flowElements.filter(element => connectors.map(c => c.reference).includes(element.name));
for (const nextElement of elementsByReferences) {
const nextIndex = flowElements.findIndex(element => nextElement.name === element.name);
if ('loops' === nextElement.subtype) {
reachedEndOfLoop = true;
}
else if (!processedLoopElementIndexes.includes(nextIndex)) {
indexesToProcess.push(nextIndex);
}
}
if (dmlStatementTypes.includes(element.subtype)) {
dmlInLoopIndexes.push(index);
}
if (connectors.length > 0) {
const elementsByReferences = flowElements.filter(element => connectors.map(c => c.reference).includes(element.name));
for (const nextElement of elementsByReferences) {
const nextIndex = flowElements.findIndex(element => nextElement.name === element.name);
if ('loops' === nextElement.subtype) {
reachedEndOfLoop = true;
}
else if (!processedLoopElementIndexes.includes(nextIndex)) {
indexesToProcess.push(nextIndex);
}
}
processedLoopElementIndexes.push(index);
}
processedLoopElementIndexes.push(index);
}

@@ -51,0 +52,0 @@ }

{
"name": "lightning-flow-scanner-core",
"version": "1.0.17",
"version": "1.0.18",
"main": "out/**",

@@ -5,0 +5,0 @@ "types": "out/index.d.ts",

@@ -1,15 +0,16 @@

# Lightning Flow Scanner(Core)
### _Used in both the VSCode extension as well as SFDX plugin with the same name._
# Lightning Flow Scanner(Rule Engine)
## Rules Included:
### _The core contains the rule engine used in both the [VSCode extension](https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightningflowscanner&ssr=false#review-details) and the [SFDX plugin](https://www.npmjs.com/package/lightning-flow-scanner)._
DML statements in a loop,
Duplicate DML operations,
Hardcoded Ids,
Missing flow description,
Missing error handlers,
Missing null handlers,
Unconnected elements(auto-fix),
Unused variables(auto-fix)
## Available Rules:
* DML statements in a loop
* Duplicate DML operations
* Hardcoded Ids
* Missing flow description
* Missing error handlers
* Missing null handlers
* Unconnected elements(fixable)
* Unused variables(fixable)
## Functions

@@ -16,0 +17,0 @@

@@ -28,27 +28,28 @@ import {IRuleDefinition} from '../interfaces/IRuleDefinition';

indexesToProcess = indexesToProcess.filter(index => !processedLoopElementIndexes.includes(index));
if (indexesToProcess.length > 0) {
for (const [index, element] of flowElements.entries()) {
if (indexesToProcess.includes(index)) {
const connectors = [];
for (const connector of element.connectors) {
if (connector.reference) {
connectors.push(connector);
}
if(indexesToProcess.length <= 0 || (indexesToProcess.length == 1 && indexesToProcess[0] == -1)){
break;
}
for (const [index, element] of flowElements.entries()) {
if (indexesToProcess.includes(index)) {
const connectors = [];
for (const connector of element.connectors) {
if (connector.reference) {
connectors.push(connector);
}
if (dmlStatementTypes.includes(element.subtype)) {
dmlInLoopIndexes.push(index);
}
if (connectors.length > 0) {
const elementsByReferences = flowElements.filter(element => connectors.map(c => c.reference).includes(element.name));
for (const nextElement of elementsByReferences) {
const nextIndex = flowElements.findIndex(element => nextElement.name === element.name);
if ('loops' === nextElement.subtype) {
reachedEndOfLoop = true;
} else if (!processedLoopElementIndexes.includes(nextIndex)) {
indexesToProcess.push(nextIndex);
}
}
if (dmlStatementTypes.includes(element.subtype)) {
dmlInLoopIndexes.push(index);
}
if (connectors.length > 0) {
const elementsByReferences = flowElements.filter(element => connectors.map(c => c.reference).includes(element.name));
for (const nextElement of elementsByReferences) {
const nextIndex = flowElements.findIndex(element => nextElement.name === element.name);
if ('loops' === nextElement.subtype) {
reachedEndOfLoop = true;
} else if (!processedLoopElementIndexes.includes(nextIndex)) {
indexesToProcess.push(nextIndex);
}
}
processedLoopElementIndexes.push(index);
}
processedLoopElementIndexes.push(index);
}

@@ -55,0 +56,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc