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 core rule set is used in both the [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightningflowscanner&ssr=false#review-details) and the [SFDX Plugin](https://www.npmjs.com/package/lightning-flow-scan

  • 2.27.0
  • Source
  • npm
  • Socket score

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

Lightning Flow Scanner(Rule Set)

This core rule set is used in both the VS Code Extension and the SFDX Plugin of the same name.

Rules


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.

Default Value: >49.0

Configuration example:

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

Configuration ID: APIVersion (View source code)


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.

Configuration ID: CopyAPIName (View source code)


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.

Configuration ID: DMLStatementInLoop (View source code)


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.

Configuration ID: DuplicateDMLOperation (View source code)


Missing Flow Description

Descriptions play a vital role in documentation. We highly recommend including details about where they are used and their intended purpose.

Configuration ID: FlowDescription (View source code)


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'.

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 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.

Configuration ID: HardcodedId (View source code)


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.

Configuration ID: MissingFaultPath (View source code)


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.

Configuration ID: MissingNullHandler (View source code)


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.

Configuration ID: SOQLQueryInLoop (View source code)


Unconnected Element

To maintain the efficiency and manageability of your Flow, it's best to avoid including unconnected elements that are not in use.

Configuration ID: UnconnectedElement (View source code)


Unused Variable

To maintain the efficiency and manageability of your Flow, it's advisable to avoid including unconnected variables that are not in use.

Configuration ID: UnusedVariable (View source code)

FAQs

Package last updated on 29 Feb 2024

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