Skip to content

Commit ddc78ff

Browse files
RubenHalmanjunners
authored andcommitted
finalize readme's
1 parent 6f9bce9 commit ddc78ff

File tree

2 files changed

+35
-27
lines changed

2 files changed

+35
-27
lines changed

example-flows/README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
# Lightning Flow Scanner Demo Repository
22

3-
Welcome to the Lightning Flow Scanner Demo Repository! Get up and running and try the Lightning Flow Scanner now using our Demo Flows. We've prepared a set of example flows that showcase various types of violations, as well as flows that demonstrate how to resolve them. This repository is designed to provide you with practical examples of best practices, ensuring you have valuable resources at your fingertips to improve your code scanning and development process. Explore, learn, and enhance your Salesforce Flow scanning capabilities with our curated test data and sample flows. Happy flow building! 🚀🌟
3+
This directory contains sample Salesforce Flows used to test Lightning Flow Scanner rules.
4+
5+
You can:
6+
7+
- Add new flows that trigger specific rules
8+
- Use these flows to demo scanner output
49

510
## Getting Started
611

7-
Follow these steps to get up and running with the Lightning Flow Scanner Demo Repository and try out our demo flows:
12+
Follow these steps to get up and running with the Lightning Flow Scanner Example Flows:
813

914
### Step 1: Clone the Repository
10-
To clone the repository, press Ctrl+Shift+P on Windows or Shift+⌘+P on macOS to open the command palette and use the Git Clone command. Alternatively, you can click the link below to clone the repository:
1115

12-
![Clone this repo](https://raw.githubusercontent.com/Force-Config-Control/Force-Flow-Control-Examples/master/docs/CloneRepository.png)
16+
To clone the repository, press Ctrl+Shift+P on Windows or Shift+⌘+P on macOS to open the command palette and use the Git Clone command.
1317

1418
### Step 2: Open in Editor
15-
When prompted, select to open the repository. This will open the cloned repository in your preferred code editor. You can also click the link below for direct access:
16-
17-
![Open in Editor](https://raw.githubusercontent.com/Force-Config-Control/Force-Flow-Control-Examples/master/docs/OpenDirectory.png)
18-
19-
### Step 3: Install Recommended Extensions
20-
Upon opening the repository, you may be prompted to install recommended extensions. It's essential to do this to ensure a smooth experience when working with the Lightning Flow Scanner. Click the link below for reference:
2119

22-
![Install Recommended Extensions](https://raw.githubusercontent.com/Force-Config-Control/Force-Flow-Control-Examples/master/docs/InstallRecommendedExtensions.png)
20+
When prompted, select to open the repository. This will open the cloned repository in your preferred code editor. You can also click the link below
2321

24-
### Step 4: Run Flow Commands
25-
Press Ctrl+Shift+P on Windows or Shift+⌘+P on macOS to open the command palette and type `Flow` to see the available commands from Lightning Flow Scanner. Examples of how the commands run can be found in the [Readme of the Extension repository](https://github.com/Force-Config-Control/lightning-flow-scanner-vsce).
22+
### Step 3: Run Flow Commands
2623

27-
![Flow Commands](https://raw.githubusercontent.com/Force-Config-Control/Force-Flow-Control-Examples/master/docs/FlowCommands.png)
24+
Press Ctrl+Shift+P on Windows or Shift+⌘+P on macOS to open the command palette and type `Flow` to see the available commands from Lightning Flow Scanner. From here you can run the scanning functionality.

readme.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Lightning Flow Scanner Banner](./media/bannerslim.png)](https://github.com/Lightning-Flow-Scanner)
1+
[![Lightning Flow Scanner Banner](./media/bannerslim.png)](https://github.com/Lightning-Flow-Scanner)
22

33
_An Extensible Rule Engine capable of conducting static analysis on the metadata associated with Salesforce Lightning Flows, Process Builders, and Workflows. Used by the Lightning Flow Scanner [Salesforce CLI Plugin](https://www.npmjs.com/package/lightning-flow-scanner) and [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightningflowscanner&ssr=false#review-details)._
44

@@ -12,8 +12,8 @@ _An Extensible Rule Engine capable of conducting static analysis on the metadata
1212

1313
## Default Rules
1414

15-
| Rule (Configuration ID) | Description |
16-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
15+
| Rule (Configuration ID) | Description |
16+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1717
| **Auto Layout** ([`AutoLayout`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/AutoLayout.ts)) | With Canvas Mode set to Auto-Layout, Elements are spaced, connected, and aligned automatically, keeping your Flow neatly organized thus saving you time. |
1818
| **Outdated API Version** ([`APIVersion`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/APIVersion.ts)) | 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. |
1919
| **Copy API Name** ([`CopyAPIName`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/CopyAPIName.ts)) | 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. |
@@ -30,7 +30,7 @@ _An Extensible Rule Engine capable of conducting static analysis on the metadata
3030
| **Unconnected Element** ([`UnconnectedElement`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/UnconnectedElement.ts)) | Unconnected elements which are not being used by the Flow should be avoided to keep Flows efficient and maintainable. |
3131
| **Unused Variable** ([`UnusedVariable`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/UnusedVariable.ts)) | To maintain the efficiency and manageability of your Flow, it's advisable to avoid including unconnected variables that are not in use. |
3232
| **Unsafe Running Context** ([`UnsafeRunningContext`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/UnsafeRunningContext.ts)) | This flow is configured to run in System Mode without Sharing. This system context grants all running users the permission to view and edit all data in your org. Running a flow in System Mode without Sharing can lead to unsafe data access. |
33-
| **Same Record Field Updates** ([`SameRecordFieldUpdates`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/SameRecordFieldUpdates.ts)) | Much like triggers, before contexts can update the same record by accessing the trigger variables `$Record` without needing to invoke a DML. |
33+
| **Same Record Field Updates** ([`SameRecordFieldUpdates`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/SameRecordFieldUpdates.ts)) | Much like triggers, before contexts can update the same record by accessing the trigger variables `$Record` without needing to invoke a DML. |
3434
| **Trigger Order** ([`TriggerOrder`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/TriggerOrder.ts)) | Guarantee your flow execution order with the Trigger Order property introduced in Spring '22 |
3535
| **Cyclomatic Complexity** ([`CyclomaticComplexity`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/CyclomaticComplexity.ts)) | The number of loops and decision rules, plus the number of decisions. Use a combination of 1) subflows and 2) breaking flows into multiple concise trigger ordered flows, to reduce the cyclomatic complexity within a single flow, ensuring maintainability and simplicity. |
3636
| **Recursive After Update** ([`RecursiveAfterUpdate`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core/tree/master/src/main/rules/RecursiveAfterUpdate.ts)) | 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. |
@@ -62,17 +62,17 @@ The `fix` function attempts to automatically fix certain issues identified durin
6262

6363
### Rule Configuration
6464

65-
Using the rules section of your configurations, you can specify the list of rules to be run and provide custom rules. Furthermore, you can define the severity of violating specific rules and configure relevant attributes for some rules. Below is a breakdown of the available attributes of rule configuration:
65+
Using the rules section of your configurations, you can specify the list of rules to be run and provide custom rules. Furthermore, you can define the severity of violating specific rules and configure relevant attributes for some rules. Below is a breakdown of the available attributes of rule configuration:
6666

6767
```json
6868
{
69-
"rules": {
70-
"<RuleName>": {
71-
"severity": "<Severity>",
72-
"expression": "<Expression>",
73-
"path": "<Path>"
74-
}
69+
"rules": {
70+
"<RuleName>": {
71+
"severity": "<Severity>",
72+
"expression": "<Expression>",
73+
"path": "<Path>"
7574
}
75+
}
7676
}
7777
```
7878

@@ -113,13 +113,15 @@ rules:
113113
114114
- Optional values for severity are "error", "warning", and "note".
115115
- If severity is provided, it overwrites the default severity, which is "error".
116+
116117
- **Expression:**
117118
118119
- Expression is used to overwrite standard values in configurable rules.
120+
119121
- **Path:**
120122
121123
- If a path is provided, it can either replace an existing rule with a new rule definition or load a custom rule.
122-
- Ensure that the rule name used in the path matches the exported class name of the rule.
124+
- Ensure that the rule name used in the path matches the exported class name of the rule.
123125
124126
### Custom Rule Interface
125127
@@ -147,9 +149,11 @@ Specifying exceptions allows you to exclude specific scenarios from rule enforce
147149
- **FlowName:**
148150

149151
- The name of the flow where exceptions apply.
152+
150153
- **RuleName:**
151154

152155
- The name of the rule for which exceptions are defined.
156+
153157
- **ResultName:**
154158

155159
- The specific result or condition within the rule for which exceptions are specified.
@@ -158,32 +162,39 @@ Specifying exceptions allows you to exclude specific scenarios from rule enforce
158162

159163
Follow these steps to set up your development environment:
160164

161-
0. **Demo Flows:** test the rules against real flow metadata with a set of [example flows](./example-flows/force-app/main/default/flows) for demonstration purposes.
165+
0. **Deploy Flows(Optional):** test the rules against real flow metadata with a set of [example flows](./example-flows/force-app/main/default/flows) for demonstration purposes.
162166

163167
```bash
164168
npm run deploy:flows -- -o <your-org-alias>
165169
```
170+
166171
1. **Clone Repository**: Begin by cloning the Lightning Flow Scanner Core repository to your local machine:
167172

168173
```bash
169174
git clone https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core.git
170175
```
176+
171177
2. **Install Dependencies**: Navigate into the cloned repository directory and install the necessary dependencies using Yarn:
172178

173179
```bash
174180
cd lightning-flow-scanner-core
175181
npm install
176182
```
183+
177184
3. **Build**: Compile the TypeScript source files into JavaScript using the TypeScript compiler:
178185

179186
```bash
180187
npm run build
181188
```
189+
182190
This command generates the compiled JavaScript files in the `out` directory.
191+
183192
4. **Run Tests**: Ensure the module functions correctly by running the test suites:
184193

185194
```bash
186195
npm run test
187196
```
197+
188198
This command uses Mocha to run tests located in the `tests` directory and provides feedback on the module's functionality.
199+
189200
5. **Debugging in IDE**: If needed, set up your integrated development environment (IDE) for debugging TypeScript code. Configure breakpoints, inspect variables, and step through the code to identify and resolve issues efficiently.

0 commit comments

Comments
 (0)