Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lightning-flow-scanner-core

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightning-flow-scanner-core

##### _This the rule engine is 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-sca

  • 2.16.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
increased by29.07%
Maintainers
1
Weekly downloads
 
Created
Source

Lightning Flow Scanner(Rule Engine)

This the rule engine is used in both the VSCode extension and the SFDX plugin of the same name.

Rules


Old API version

Newer API components may cause older versions of Flows to start behaving incorrectly due to differences in the underlying mechanics. The Api Version has been available as an attribute on the Flow since API v50.0 and it is recommended to limit variation and to update them on a regular basis.

Default Value: >50.0

Configuration example:

APIVersion:
    {
        severity: 'error',
        expression: '===58'
    }

Configuration ID: APIVersion (View source code)


Copy of API Name

Having multiple elements called Copy_X_Of_Element will decrease the readability of the Flow. If you copy and paste them, make sure to update the API name of the new copy.

Configuration ID: CopyOf (View source code)


DML statements in a loop

To avoid hitting Apex governor limits, we recommend grouping all of your changes together at the end of the flow, whether those changes create, update, or delete records.

Configuration ID: DMLStatementInLoop (View source code)


Duplicate DML operations

If the flow commits changes to the database or performs actions between two screens, don't let users navigate back between screen. Otherwise, the flow may perform duplicate database operations.

Configuration ID: DuplicateDMLOperations (View source code)


Missing flow description

Descriptions are useful for documentation purposes. It is recommended to provide information about where it is used and what it will do.

Configuration ID: FlowDescription (View source code)


Flow naming conventions

Readability of a flow is very important. Setting a naming convention for the Flow Name will improve the findability/searchability and overall consistency. It is recommended to at least provide a domain and a short description of the actions undertaken in the flow, in example Service_OrderFulfillment.

Default Value: [A-Za-z0-9]+_[A-Za-z0-9]+

Configuration example:

FlowName:
    {
        severity: 'error',
        expression: '[A-Za-z0-9]'
    }

Configuration ID: FlowName (View source code)


Hardcoded Ids

IDs are org-specific, so don’t hard-code IDs. Instead, pass them into variables when the flow starts. You can do so, for example, by using merge fields in URL parameters or by using a Get Records element.

Configuration ID: HardcodedIds (View source code)


Missing error handlers

Sometimes a flow doesn’t perform an operation that you configured it to do. By default, the flow shows an error message to the user and emails the admin who created the flow. However, you can control that behavior.

Configuration ID: MissingFaultPath (View source code)


Missing null handlers

If a Get Records operation does not find any data it will return null. Use a decision element on the operation result variable to validate that the result is not null.

Configuration ID: MissingNullHandler (View source code)


Unconnected elements

Unconnected elements which are not in use by the Flow should be avoided to keep the Flow as efficient and maintainable as possible.

Configuration ID: UnconnectedElements (View source code)


Unused variables

Unconnected variables which are not in use by the Flow should be avoided to keep the Flow as efficient and maintainable as possible.

Configuration ID: UnusedVariables (View source code)

FAQs

Package last updated on 02 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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