@flow-scanner/lightning-flow-scanner-core 6.17.1 → 6.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) hide show
  1. package/README.md +642 -0
  2. package/package.json +9 -58
  3. package/.husky/pre-commit +0 -1
  4. package/.husky/pre-push +0 -1
  5. package/.prettierignore +0 -5
  6. package/.swcrc +0 -26
  7. package/.turbo/turbo-build.log +0 -17
  8. package/.turbo/turbo-test.log +0 -144
  9. package/.turbo/turbo-vite$colon$dist.log +0 -21
  10. package/coverage/coverage-final.json +0 -63
  11. package/coverage/lcov-report/base.css +0 -224
  12. package/coverage/lcov-report/block-navigation.js +0 -87
  13. package/coverage/lcov-report/favicon.png +0 -0
  14. package/coverage/lcov-report/index.html +0 -236
  15. package/coverage/lcov-report/prettify.css +0 -1
  16. package/coverage/lcov-report/prettify.js +0 -2
  17. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  18. package/coverage/lcov-report/sorter.js +0 -210
  19. package/coverage/lcov-report/src/index.html +0 -116
  20. package/coverage/lcov-report/src/index.ts.html +0 -238
  21. package/coverage/lcov-report/src/main/adapters/RegexAdapter.ts.html +0 -118
  22. package/coverage/lcov-report/src/main/adapters/index.html +0 -116
  23. package/coverage/lcov-report/src/main/config/NodeIcons.ts.html +0 -376
  24. package/coverage/lcov-report/src/main/config/RuleRegistry.ts.html +0 -646
  25. package/coverage/lcov-report/src/main/config/VariableIcons.ts.html +0 -253
  26. package/coverage/lcov-report/src/main/config/index.html +0 -146
  27. package/coverage/lcov-report/src/main/enums/MetaType.ts.html +0 -100
  28. package/coverage/lcov-report/src/main/enums/MetadataType.ts.html +0 -103
  29. package/coverage/lcov-report/src/main/enums/MetadataTypes.ts.html +0 -100
  30. package/coverage/lcov-report/src/main/enums/index.html +0 -116
  31. package/coverage/lcov-report/src/main/interfaces/IRulesConfig.ts.html +0 -133
  32. package/coverage/lcov-report/src/main/interfaces/index.html +0 -116
  33. package/coverage/lcov-report/src/main/internals/index.html +0 -116
  34. package/coverage/lcov-report/src/main/internals/internals.ts.html +0 -190
  35. package/coverage/lcov-report/src/main/libs/BuildFlow.ts.html +0 -127
  36. package/coverage/lcov-report/src/main/libs/Compiler.ts.html +0 -241
  37. package/coverage/lcov-report/src/main/libs/ConvertFlowNodes.ts.html +0 -97
  38. package/coverage/lcov-report/src/main/libs/DynamicRule.ts.html +0 -118
  39. package/coverage/lcov-report/src/main/libs/ExportDetails.ts.html +0 -256
  40. package/coverage/lcov-report/src/main/libs/ExportDiagram.ts.html +0 -331
  41. package/coverage/lcov-report/src/main/libs/ExportSarif.ts.html +0 -358
  42. package/coverage/lcov-report/src/main/libs/FixFlows.ts.html +0 -265
  43. package/coverage/lcov-report/src/main/libs/GenerateMarkdown.ts.html +0 -331
  44. package/coverage/lcov-report/src/main/libs/GetRuleDefinitions.ts.html +0 -274
  45. package/coverage/lcov-report/src/main/libs/ParseFlows.ts.html +0 -184
  46. package/coverage/lcov-report/src/main/libs/RuleDocumentation.ts.html +0 -190
  47. package/coverage/lcov-report/src/main/libs/ScanFlows.ts.html +0 -508
  48. package/coverage/lcov-report/src/main/libs/exportAsDetails.ts.html +0 -160
  49. package/coverage/lcov-report/src/main/libs/exportAsSarif.ts.html +0 -346
  50. package/coverage/lcov-report/src/main/libs/index.html +0 -251
  51. package/coverage/lcov-report/src/main/models/FlatViolation.ts.html +0 -106
  52. package/coverage/lcov-report/src/main/models/Flow.ts.html +0 -1057
  53. package/coverage/lcov-report/src/main/models/FlowAttribute.ts.html +0 -115
  54. package/coverage/lcov-report/src/main/models/FlowElement.ts.html +0 -133
  55. package/coverage/lcov-report/src/main/models/FlowElementConnector.ts.html +0 -169
  56. package/coverage/lcov-report/src/main/models/FlowGraph.ts.html +0 -1672
  57. package/coverage/lcov-report/src/main/models/FlowMetadata.ts.html +0 -106
  58. package/coverage/lcov-report/src/main/models/FlowNode.ts.html +0 -1252
  59. package/coverage/lcov-report/src/main/models/FlowResource.ts.html +0 -106
  60. package/coverage/lcov-report/src/main/models/FlowType.ts.html +0 -244
  61. package/coverage/lcov-report/src/main/models/FlowVariable.ts.html +0 -553
  62. package/coverage/lcov-report/src/main/models/LoopRuleCommon.ts.html +0 -235
  63. package/coverage/lcov-report/src/main/models/ParsedFlow.ts.html +0 -121
  64. package/coverage/lcov-report/src/main/models/RuleCommon.ts.html +0 -442
  65. package/coverage/lcov-report/src/main/models/RuleResult.ts.html +0 -172
  66. package/coverage/lcov-report/src/main/models/ScanResult.ts.html +0 -121
  67. package/coverage/lcov-report/src/main/models/Violation.ts.html +0 -316
  68. package/coverage/lcov-report/src/main/models/index.html +0 -341
  69. package/coverage/lcov-report/src/main/rules/APIVersion.ts.html +0 -361
  70. package/coverage/lcov-report/src/main/rules/ActionCallsInLoop.ts.html +0 -157
  71. package/coverage/lcov-report/src/main/rules/AutoLayout.ts.html +0 -220
  72. package/coverage/lcov-report/src/main/rules/CopyAPIName.ts.html +0 -175
  73. package/coverage/lcov-report/src/main/rules/CyclomaticComplexity.ts.html +0 -292
  74. package/coverage/lcov-report/src/main/rules/DMLStatementInLoop.ts.html +0 -163
  75. package/coverage/lcov-report/src/main/rules/DuplicateDMLOperation.ts.html +0 -334
  76. package/coverage/lcov-report/src/main/rules/FlowDescription.ts.html +0 -184
  77. package/coverage/lcov-report/src/main/rules/FlowName.ts.html +0 -229
  78. package/coverage/lcov-report/src/main/rules/GetRecordAllFields.ts.html +0 -280
  79. package/coverage/lcov-report/src/main/rules/HardcodedId.ts.html +0 -238
  80. package/coverage/lcov-report/src/main/rules/HardcodedSecret.ts.html +0 -238
  81. package/coverage/lcov-report/src/main/rules/HardcodedUrl.ts.html +0 -247
  82. package/coverage/lcov-report/src/main/rules/InactiveFlow.ts.html +0 -184
  83. package/coverage/lcov-report/src/main/rules/MissingFaultPath.ts.html +0 -397
  84. package/coverage/lcov-report/src/main/rules/MissingFilterRecordTrigger.ts.html +0 -229
  85. package/coverage/lcov-report/src/main/rules/MissingMetadataDescription.ts.html +0 -211
  86. package/coverage/lcov-report/src/main/rules/MissingNullHandler.ts.html +0 -460
  87. package/coverage/lcov-report/src/main/rules/MissingRecordTriggerFilter.ts.html +0 -235
  88. package/coverage/lcov-report/src/main/rules/ProcessBuilder.ts.html +0 -190
  89. package/coverage/lcov-report/src/main/rules/RecordIdAsString.ts.html +0 -274
  90. package/coverage/lcov-report/src/main/rules/RecursiveAfterUpdate.ts.html +0 -364
  91. package/coverage/lcov-report/src/main/rules/SOQLQueryInLoop.ts.html +0 -160
  92. package/coverage/lcov-report/src/main/rules/SameRecordFieldUpdates.ts.html +0 -283
  93. package/coverage/lcov-report/src/main/rules/TransformInsteadOfLoop.ts.html +0 -250
  94. package/coverage/lcov-report/src/main/rules/TriggerOrder.ts.html +0 -238
  95. package/coverage/lcov-report/src/main/rules/UnconnectedElement.ts.html +0 -178
  96. package/coverage/lcov-report/src/main/rules/UnsafeRunningContext.ts.html +0 -226
  97. package/coverage/lcov-report/src/main/rules/UnusedVariable.ts.html +0 -283
  98. package/coverage/lcov-report/src/main/rules/index.html +0 -521
  99. package/coverage/lcov-report/src/main/store/DefaultRuleStore.ts.html +0 -265
  100. package/coverage/lcov-report/src/main/store/RuleRegistry.ts.html +0 -118
  101. package/coverage/lcov-report/src/main/store/index.html +0 -116
  102. package/coverage/lcov.info +0 -6261
  103. package/eslint.config.mjs +0 -36
  104. package/jest.config.cjs +0 -32
  105. package/jest.env-setup.js +0 -101
  106. package/lint-staged.config.mjs +0 -8
  107. package/prettier.config.mjs +0 -5
  108. package/src/index.ts +0 -52
  109. package/src/main/config/NodeIcons.ts +0 -98
  110. package/src/main/config/RegexAdapter.ts +0 -98
  111. package/src/main/config/RuleRegistry.ts +0 -188
  112. package/src/main/config/VariableIcons.ts +0 -57
  113. package/src/main/enums/MetadataTypes.ts +0 -6
  114. package/src/main/interfaces/IExceptions.ts +0 -6
  115. package/src/main/interfaces/IRuleConfig.ts +0 -6
  116. package/src/main/interfaces/IRuleDefinition.ts +0 -15
  117. package/src/main/interfaces/IRuleOptions.ts +0 -5
  118. package/src/main/interfaces/IRulesConfig.ts +0 -17
  119. package/src/main/internals/internals.ts +0 -35
  120. package/src/main/libs/BuildFlow.ts +0 -14
  121. package/src/main/libs/Compiler.ts +0 -53
  122. package/src/main/libs/ExportDetails.ts +0 -58
  123. package/src/main/libs/ExportDiagram.ts +0 -83
  124. package/src/main/libs/ExportSarif.ts +0 -92
  125. package/src/main/libs/FixFlows.ts +0 -61
  126. package/src/main/libs/GetRuleDefinitions.ts +0 -64
  127. package/src/main/libs/ParseFlows.ts +0 -34
  128. package/src/main/libs/RuleDocumentation.ts +0 -35
  129. package/src/main/libs/ScanFlows.ts +0 -142
  130. package/src/main/models/FlatViolation.ts +0 -16
  131. package/src/main/models/Flow.ts +0 -325
  132. package/src/main/models/FlowAttribute.ts +0 -11
  133. package/src/main/models/FlowElement.ts +0 -16
  134. package/src/main/models/FlowElementConnector.ts +0 -28
  135. package/src/main/models/FlowGraph.ts +0 -530
  136. package/src/main/models/FlowMetadata.ts +0 -8
  137. package/src/main/models/FlowNode.ts +0 -390
  138. package/src/main/models/FlowResource.ts +0 -8
  139. package/src/main/models/FlowType.ts +0 -53
  140. package/src/main/models/FlowVariable.ts +0 -157
  141. package/src/main/models/LoopRuleCommon.ts +0 -51
  142. package/src/main/models/ParsedFlow.ts +0 -13
  143. package/src/main/models/RuleCommon.ts +0 -120
  144. package/src/main/models/RuleInfo.ts +0 -54
  145. package/src/main/models/RuleResult.ts +0 -29
  146. package/src/main/models/ScanResult.ts +0 -12
  147. package/src/main/models/Violation.ts +0 -78
  148. package/src/main/rules/APIVersion.ts +0 -93
  149. package/src/main/rules/ActionCallsInLoop.ts +0 -25
  150. package/src/main/rules/AutoLayout.ts +0 -46
  151. package/src/main/rules/CopyAPIName.ts +0 -31
  152. package/src/main/rules/CyclomaticComplexity.ts +0 -70
  153. package/src/main/rules/DMLStatementInLoop.ts +0 -26
  154. package/src/main/rules/DuplicateDMLOperation.ts +0 -83
  155. package/src/main/rules/FlowDescription.ts +0 -34
  156. package/src/main/rules/FlowName.ts +0 -49
  157. package/src/main/rules/GetRecordAllFields.ts +0 -65
  158. package/src/main/rules/HardcodedId.ts +0 -51
  159. package/src/main/rules/HardcodedSecret.ts +0 -51
  160. package/src/main/rules/HardcodedUrl.ts +0 -54
  161. package/src/main/rules/InactiveFlow.ts +0 -33
  162. package/src/main/rules/MissingFaultPath.ts +0 -105
  163. package/src/main/rules/MissingMetadataDescription.ts +0 -42
  164. package/src/main/rules/MissingNullHandler.ts +0 -126
  165. package/src/main/rules/MissingRecordTriggerFilter.ts +0 -51
  166. package/src/main/rules/ProcessBuilder.ts +0 -35
  167. package/src/main/rules/RecordIdAsString.ts +0 -64
  168. package/src/main/rules/RecursiveAfterUpdate.ts +0 -94
  169. package/src/main/rules/SOQLQueryInLoop.ts +0 -26
  170. package/src/main/rules/SameRecordFieldUpdates.ts +0 -66
  171. package/src/main/rules/TransformInsteadOfLoop.ts +0 -56
  172. package/src/main/rules/TriggerOrder.ts +0 -51
  173. package/src/main/rules/UnconnectedElement.ts +0 -32
  174. package/src/main/rules/UnsafeRunningContext.ts +0 -47
  175. package/src/main/rules/UnusedVariable.ts +0 -66
  176. package/stryker.config.mjs +0 -23
  177. package/tests/APIVersion.test.ts +0 -87
  178. package/tests/AutoLayout.test.ts +0 -41
  179. package/tests/Config.test.ts +0 -122
  180. package/tests/ConfigBetaMode.test.ts +0 -26
  181. package/tests/CopyAPIName.test.ts +0 -45
  182. package/tests/CyclomaticComplexity.test.ts +0 -125
  183. package/tests/DMLStatementInLoop.test.ts +0 -32
  184. package/tests/DuplicateDMLOperation.test.ts +0 -43
  185. package/tests/EnabledFalse.test.ts +0 -63
  186. package/tests/Exceptions.test.ts +0 -815
  187. package/tests/ExportSarif.test.ts +0 -62
  188. package/tests/FlowDescription.test.ts +0 -44
  189. package/tests/FlowDocumentation.test.ts +0 -74
  190. package/tests/FlowName.test.ts +0 -61
  191. package/tests/GetRecordElementAllFields.test.ts +0 -182
  192. package/tests/HardcodedId.test.ts +0 -16
  193. package/tests/HardcodedSecret.test.ts +0 -32
  194. package/tests/HardcodedUrl.test.ts +0 -253
  195. package/tests/InactiveFlow.test.ts +0 -103
  196. package/tests/MissingFaultPath.test.ts +0 -52
  197. package/tests/MissingMetadataDescription.test.ts +0 -25
  198. package/tests/MissingNullHandler.test.ts +0 -45
  199. package/tests/MissingRecordTriggerFilter.test.ts +0 -54
  200. package/tests/RecordIdAsString.test.ts +0 -60
  201. package/tests/RecursiveAfterUpdate.test.ts +0 -183
  202. package/tests/SOQLQueryInLoop.test.ts +0 -33
  203. package/tests/SameRecordFieldUpdates.test.ts +0 -205
  204. package/tests/SanityTest.test.ts +0 -15
  205. package/tests/TransformInsteadOfLoop.test.ts +0 -33
  206. package/tests/TriggerOrder.test.ts +0 -112
  207. package/tests/UnconnectedElement.test.ts +0 -76
  208. package/tests/UnsafeRunningContext.test.ts +0 -46
  209. package/tests/UnusedVariable.test.ts +0 -59
  210. package/tests/UnusedVariableExceptions.test.ts +0 -87
  211. package/tests/jsonfiles/MissingFaultPath_BeforeSave_Bypass.json +0 -128
  212. package/tests/jsonfiles/MissingFaultPath_WaitConditions.json +0 -102
  213. package/tests/jsonfiles/MissingFaultPath_WaitDate.json +0 -88
  214. package/tests/jsonfiles/MissingFaultPath_WaitDuration.json +0 -90
  215. package/tests/models/Flow.test.ts +0 -107
  216. package/tests/models/LoopRuleCommon.test.ts +0 -246
  217. package/tests/models/RuleCommon.test.ts +0 -41
  218. package/tsconfig.json +0 -28
  219. package/tsconfig.types.json +0 -26
  220. package/types/index.d.ts +0 -27
  221. package/types/index.d.ts.map +0 -1
  222. package/types/main/adapters/RegexAdapter.d.ts +0 -33
  223. package/types/main/adapters/RegexAdapter.d.ts.map +0 -1
  224. package/types/main/config/NodeIcons.d.ts +0 -25
  225. package/types/main/config/NodeIcons.d.ts.map +0 -1
  226. package/types/main/config/RegexAdapter.d.ts +0 -33
  227. package/types/main/config/RegexAdapter.d.ts.map +0 -1
  228. package/types/main/config/RuleRegistry.d.ts +0 -23
  229. package/types/main/config/RuleRegistry.d.ts.map +0 -1
  230. package/types/main/config/VariableIcons.d.ts +0 -26
  231. package/types/main/config/VariableIcons.d.ts.map +0 -1
  232. package/types/main/enums/MetadataTypes.d.ts +0 -7
  233. package/types/main/enums/MetadataTypes.d.ts.map +0 -1
  234. package/types/main/interfaces/IExceptions.d.ts +0 -6
  235. package/types/main/interfaces/IExceptions.d.ts.map +0 -1
  236. package/types/main/interfaces/IRuleConfig.d.ts +0 -7
  237. package/types/main/interfaces/IRuleConfig.d.ts.map +0 -1
  238. package/types/main/interfaces/IRuleDefinition.d.ts +0 -18
  239. package/types/main/interfaces/IRuleDefinition.d.ts.map +0 -1
  240. package/types/main/interfaces/IRuleOptions.d.ts +0 -5
  241. package/types/main/interfaces/IRuleOptions.d.ts.map +0 -1
  242. package/types/main/interfaces/IRulesConfig.d.ts +0 -16
  243. package/types/main/interfaces/IRulesConfig.d.ts.map +0 -1
  244. package/types/main/internals/internals.d.ts +0 -19
  245. package/types/main/internals/internals.d.ts.map +0 -1
  246. package/types/main/libs/BuildFlow.d.ts +0 -2
  247. package/types/main/libs/BuildFlow.d.ts.map +0 -1
  248. package/types/main/libs/Compiler.d.ts +0 -8
  249. package/types/main/libs/Compiler.d.ts.map +0 -1
  250. package/types/main/libs/ConvertFlowNodes.d.ts +0 -2
  251. package/types/main/libs/ConvertFlowNodes.d.ts.map +0 -1
  252. package/types/main/libs/DynamicRule.d.ts +0 -5
  253. package/types/main/libs/DynamicRule.d.ts.map +0 -1
  254. package/types/main/libs/ExportDetails.d.ts +0 -4
  255. package/types/main/libs/ExportDetails.d.ts.map +0 -1
  256. package/types/main/libs/ExportDiagram.d.ts +0 -42
  257. package/types/main/libs/ExportDiagram.d.ts.map +0 -1
  258. package/types/main/libs/ExportSarif.d.ts +0 -3
  259. package/types/main/libs/ExportSarif.d.ts.map +0 -1
  260. package/types/main/libs/FixFlows.d.ts +0 -4
  261. package/types/main/libs/FixFlows.d.ts.map +0 -1
  262. package/types/main/libs/GetRuleDefinitions.d.ts +0 -5
  263. package/types/main/libs/GetRuleDefinitions.d.ts.map +0 -1
  264. package/types/main/libs/ParseFlows.d.ts +0 -3
  265. package/types/main/libs/ParseFlows.d.ts.map +0 -1
  266. package/types/main/libs/RuleDocumentation.d.ts +0 -21
  267. package/types/main/libs/RuleDocumentation.d.ts.map +0 -1
  268. package/types/main/libs/ScanFlows.d.ts +0 -5
  269. package/types/main/libs/ScanFlows.d.ts.map +0 -1
  270. package/types/main/libs/exportAsDetails.d.ts +0 -4
  271. package/types/main/libs/exportAsDetails.d.ts.map +0 -1
  272. package/types/main/libs/exportAsSarif.d.ts +0 -3
  273. package/types/main/libs/exportAsSarif.d.ts.map +0 -1
  274. package/types/main/models/FlatViolation.d.ts +0 -16
  275. package/types/main/models/FlatViolation.d.ts.map +0 -1
  276. package/types/main/models/Flow.d.ts +0 -70
  277. package/types/main/models/Flow.d.ts.map +0 -1
  278. package/types/main/models/FlowAttribute.d.ts +0 -6
  279. package/types/main/models/FlowAttribute.d.ts.map +0 -1
  280. package/types/main/models/FlowElement.d.ts +0 -11
  281. package/types/main/models/FlowElement.d.ts.map +0 -1
  282. package/types/main/models/FlowElementConnector.d.ts +0 -16
  283. package/types/main/models/FlowElementConnector.d.ts.map +0 -1
  284. package/types/main/models/FlowGraph.d.ts +0 -86
  285. package/types/main/models/FlowGraph.d.ts.map +0 -1
  286. package/types/main/models/FlowMetadata.d.ts +0 -5
  287. package/types/main/models/FlowMetadata.d.ts.map +0 -1
  288. package/types/main/models/FlowNode.d.ts +0 -66
  289. package/types/main/models/FlowNode.d.ts.map +0 -1
  290. package/types/main/models/FlowResource.d.ts +0 -5
  291. package/types/main/models/FlowResource.d.ts.map +0 -1
  292. package/types/main/models/FlowType.d.ts +0 -24
  293. package/types/main/models/FlowType.d.ts.map +0 -1
  294. package/types/main/models/FlowVariable.d.ts +0 -64
  295. package/types/main/models/FlowVariable.d.ts.map +0 -1
  296. package/types/main/models/LoopRuleCommon.d.ts +0 -15
  297. package/types/main/models/LoopRuleCommon.d.ts.map +0 -1
  298. package/types/main/models/ParsedFlow.d.ts +0 -8
  299. package/types/main/models/ParsedFlow.d.ts.map +0 -1
  300. package/types/main/models/RuleCommon.d.ts +0 -58
  301. package/types/main/models/RuleCommon.d.ts.map +0 -1
  302. package/types/main/models/RuleInfo.d.ts +0 -50
  303. package/types/main/models/RuleInfo.d.ts.map +0 -1
  304. package/types/main/models/RuleResult.d.ts +0 -15
  305. package/types/main/models/RuleResult.d.ts.map +0 -1
  306. package/types/main/models/ScanResult.d.ts +0 -8
  307. package/types/main/models/ScanResult.d.ts.map +0 -1
  308. package/types/main/models/Violation.d.ts +0 -12
  309. package/types/main/models/Violation.d.ts.map +0 -1
  310. package/types/main/rules/APIVersion.d.ts +0 -10
  311. package/types/main/rules/APIVersion.d.ts.map +0 -1
  312. package/types/main/rules/ActionCallsInLoop.d.ts +0 -7
  313. package/types/main/rules/ActionCallsInLoop.d.ts.map +0 -1
  314. package/types/main/rules/AutoLayout.d.ts +0 -8
  315. package/types/main/rules/AutoLayout.d.ts.map +0 -1
  316. package/types/main/rules/CopyAPIName.d.ts +0 -8
  317. package/types/main/rules/CopyAPIName.d.ts.map +0 -1
  318. package/types/main/rules/CyclomaticComplexity.d.ts +0 -12
  319. package/types/main/rules/CyclomaticComplexity.d.ts.map +0 -1
  320. package/types/main/rules/DMLStatementInLoop.d.ts +0 -7
  321. package/types/main/rules/DMLStatementInLoop.d.ts.map +0 -1
  322. package/types/main/rules/DuplicateDMLOperation.d.ts +0 -9
  323. package/types/main/rules/DuplicateDMLOperation.d.ts.map +0 -1
  324. package/types/main/rules/FlowDescription.d.ts +0 -8
  325. package/types/main/rules/FlowDescription.d.ts.map +0 -1
  326. package/types/main/rules/FlowName.d.ts +0 -16
  327. package/types/main/rules/FlowName.d.ts.map +0 -1
  328. package/types/main/rules/GetRecordAllFields.d.ts +0 -8
  329. package/types/main/rules/GetRecordAllFields.d.ts.map +0 -1
  330. package/types/main/rules/HardcodedId.d.ts +0 -14
  331. package/types/main/rules/HardcodedId.d.ts.map +0 -1
  332. package/types/main/rules/HardcodedSecret.d.ts +0 -14
  333. package/types/main/rules/HardcodedSecret.d.ts.map +0 -1
  334. package/types/main/rules/HardcodedUrl.d.ts +0 -14
  335. package/types/main/rules/HardcodedUrl.d.ts.map +0 -1
  336. package/types/main/rules/InactiveFlow.d.ts +0 -8
  337. package/types/main/rules/InactiveFlow.d.ts.map +0 -1
  338. package/types/main/rules/MissingFaultPath.d.ts +0 -15
  339. package/types/main/rules/MissingFaultPath.d.ts.map +0 -1
  340. package/types/main/rules/MissingFilterRecordTrigger.d.ts +0 -8
  341. package/types/main/rules/MissingFilterRecordTrigger.d.ts.map +0 -1
  342. package/types/main/rules/MissingMetadataDescription.d.ts +0 -8
  343. package/types/main/rules/MissingMetadataDescription.d.ts.map +0 -1
  344. package/types/main/rules/MissingNullHandler.d.ts +0 -8
  345. package/types/main/rules/MissingNullHandler.d.ts.map +0 -1
  346. package/types/main/rules/MissingRecordTriggerFilter.d.ts +0 -8
  347. package/types/main/rules/MissingRecordTriggerFilter.d.ts.map +0 -1
  348. package/types/main/rules/ProcessBuilder.d.ts +0 -8
  349. package/types/main/rules/ProcessBuilder.d.ts.map +0 -1
  350. package/types/main/rules/RecordIdAsString.d.ts +0 -8
  351. package/types/main/rules/RecordIdAsString.d.ts.map +0 -1
  352. package/types/main/rules/RecursiveAfterUpdate.d.ts +0 -9
  353. package/types/main/rules/RecursiveAfterUpdate.d.ts.map +0 -1
  354. package/types/main/rules/SOQLQueryInLoop.d.ts +0 -7
  355. package/types/main/rules/SOQLQueryInLoop.d.ts.map +0 -1
  356. package/types/main/rules/SameRecordFieldUpdates.d.ts +0 -9
  357. package/types/main/rules/SameRecordFieldUpdates.d.ts.map +0 -1
  358. package/types/main/rules/TransformInsteadOfLoop.d.ts +0 -8
  359. package/types/main/rules/TransformInsteadOfLoop.d.ts.map +0 -1
  360. package/types/main/rules/TriggerOrder.d.ts +0 -8
  361. package/types/main/rules/TriggerOrder.d.ts.map +0 -1
  362. package/types/main/rules/UnconnectedElement.d.ts +0 -8
  363. package/types/main/rules/UnconnectedElement.d.ts.map +0 -1
  364. package/types/main/rules/UnsafeRunningContext.d.ts +0 -8
  365. package/types/main/rules/UnsafeRunningContext.d.ts.map +0 -1
  366. package/types/main/rules/UnusedVariable.d.ts +0 -8
  367. package/types/main/rules/UnusedVariable.d.ts.map +0 -1
  368. package/types/main/store/DefaultRuleStore.d.ts +0 -3
  369. package/types/main/store/DefaultRuleStore.d.ts.map +0 -1
  370. package/types/main/store/RuleRegistry.d.ts +0 -23
  371. package/types/main/store/RuleRegistry.d.ts.map +0 -1
  372. package/vite.config.ts +0 -33
  373. /package/{out/index.d.ts → index.d.ts} +0 -0
  374. /package/{out/index.js → index.js} +0 -0
  375. /package/{out/main → main}/config/NodeIcons.d.ts +0 -0
  376. /package/{out/main → main}/config/NodeIcons.js +0 -0
  377. /package/{out/main → main}/config/RegexAdapter.d.ts +0 -0
  378. /package/{out/main → main}/config/RegexAdapter.js +0 -0
  379. /package/{out/main → main}/config/RuleRegistry.d.ts +0 -0
  380. /package/{out/main → main}/config/RuleRegistry.js +0 -0
  381. /package/{out/main → main}/config/VariableIcons.d.ts +0 -0
  382. /package/{out/main → main}/config/VariableIcons.js +0 -0
  383. /package/{out/main → main}/enums/MetadataTypes.d.ts +0 -0
  384. /package/{out/main → main}/enums/MetadataTypes.js +0 -0
  385. /package/{out/main → main}/interfaces/IExceptions.d.ts +0 -0
  386. /package/{out/main → main}/interfaces/IExceptions.js +0 -0
  387. /package/{out/main → main}/interfaces/IRuleConfig.d.ts +0 -0
  388. /package/{out/main → main}/interfaces/IRuleConfig.js +0 -0
  389. /package/{out/main → main}/interfaces/IRuleDefinition.d.ts +0 -0
  390. /package/{out/main → main}/interfaces/IRuleDefinition.js +0 -0
  391. /package/{out/main → main}/interfaces/IRuleOptions.d.ts +0 -0
  392. /package/{out/main → main}/interfaces/IRuleOptions.js +0 -0
  393. /package/{out/main → main}/interfaces/IRulesConfig.d.ts +0 -0
  394. /package/{out/main → main}/interfaces/IRulesConfig.js +0 -0
  395. /package/{out/main → main}/internals/internals.d.ts +0 -0
  396. /package/{out/main → main}/internals/internals.js +0 -0
  397. /package/{out/main → main}/libs/BuildFlow.d.ts +0 -0
  398. /package/{out/main → main}/libs/BuildFlow.js +0 -0
  399. /package/{out/main → main}/libs/Compiler.d.ts +0 -0
  400. /package/{out/main → main}/libs/Compiler.js +0 -0
  401. /package/{out/main → main}/libs/ExportDetails.d.ts +0 -0
  402. /package/{out/main → main}/libs/ExportDetails.js +0 -0
  403. /package/{out/main → main}/libs/ExportDiagram.d.ts +0 -0
  404. /package/{out/main → main}/libs/ExportDiagram.js +0 -0
  405. /package/{out/main → main}/libs/ExportSarif.d.ts +0 -0
  406. /package/{out/main → main}/libs/ExportSarif.js +0 -0
  407. /package/{out/main → main}/libs/FixFlows.d.ts +0 -0
  408. /package/{out/main → main}/libs/FixFlows.js +0 -0
  409. /package/{out/main → main}/libs/GetRuleDefinitions.d.ts +0 -0
  410. /package/{out/main → main}/libs/GetRuleDefinitions.js +0 -0
  411. /package/{out/main → main}/libs/ParseFlows.d.ts +0 -0
  412. /package/{out/main → main}/libs/ParseFlows.js +0 -0
  413. /package/{out/main → main}/libs/RuleDocumentation.d.ts +0 -0
  414. /package/{out/main → main}/libs/RuleDocumentation.js +0 -0
  415. /package/{out/main → main}/libs/ScanFlows.d.ts +0 -0
  416. /package/{out/main → main}/libs/ScanFlows.js +0 -0
  417. /package/{out/main → main}/models/FlatViolation.d.ts +0 -0
  418. /package/{out/main → main}/models/FlatViolation.js +0 -0
  419. /package/{out/main → main}/models/Flow.d.ts +0 -0
  420. /package/{out/main → main}/models/Flow.js +0 -0
  421. /package/{out/main → main}/models/FlowAttribute.d.ts +0 -0
  422. /package/{out/main → main}/models/FlowAttribute.js +0 -0
  423. /package/{out/main → main}/models/FlowElement.d.ts +0 -0
  424. /package/{out/main → main}/models/FlowElement.js +0 -0
  425. /package/{out/main → main}/models/FlowElementConnector.d.ts +0 -0
  426. /package/{out/main → main}/models/FlowElementConnector.js +0 -0
  427. /package/{out/main → main}/models/FlowGraph.d.ts +0 -0
  428. /package/{out/main → main}/models/FlowGraph.js +0 -0
  429. /package/{out/main → main}/models/FlowMetadata.d.ts +0 -0
  430. /package/{out/main → main}/models/FlowMetadata.js +0 -0
  431. /package/{out/main → main}/models/FlowNode.d.ts +0 -0
  432. /package/{out/main → main}/models/FlowNode.js +0 -0
  433. /package/{out/main → main}/models/FlowResource.d.ts +0 -0
  434. /package/{out/main → main}/models/FlowResource.js +0 -0
  435. /package/{out/main → main}/models/FlowType.d.ts +0 -0
  436. /package/{out/main → main}/models/FlowType.js +0 -0
  437. /package/{out/main → main}/models/FlowVariable.d.ts +0 -0
  438. /package/{out/main → main}/models/FlowVariable.js +0 -0
  439. /package/{out/main → main}/models/LoopRuleCommon.d.ts +0 -0
  440. /package/{out/main → main}/models/LoopRuleCommon.js +0 -0
  441. /package/{out/main → main}/models/ParsedFlow.d.ts +0 -0
  442. /package/{out/main → main}/models/ParsedFlow.js +0 -0
  443. /package/{out/main → main}/models/RuleCommon.d.ts +0 -0
  444. /package/{out/main → main}/models/RuleCommon.js +0 -0
  445. /package/{out/main → main}/models/RuleInfo.d.ts +0 -0
  446. /package/{out/main → main}/models/RuleInfo.js +0 -0
  447. /package/{out/main → main}/models/RuleResult.d.ts +0 -0
  448. /package/{out/main → main}/models/RuleResult.js +0 -0
  449. /package/{out/main → main}/models/ScanResult.d.ts +0 -0
  450. /package/{out/main → main}/models/ScanResult.js +0 -0
  451. /package/{out/main → main}/models/Violation.d.ts +0 -0
  452. /package/{out/main → main}/models/Violation.js +0 -0
  453. /package/{out/main → main}/rules/APIVersion.d.ts +0 -0
  454. /package/{out/main → main}/rules/APIVersion.js +0 -0
  455. /package/{out/main → main}/rules/ActionCallsInLoop.d.ts +0 -0
  456. /package/{out/main → main}/rules/ActionCallsInLoop.js +0 -0
  457. /package/{out/main → main}/rules/AutoLayout.d.ts +0 -0
  458. /package/{out/main → main}/rules/AutoLayout.js +0 -0
  459. /package/{out/main → main}/rules/CopyAPIName.d.ts +0 -0
  460. /package/{out/main → main}/rules/CopyAPIName.js +0 -0
  461. /package/{out/main → main}/rules/CyclomaticComplexity.d.ts +0 -0
  462. /package/{out/main → main}/rules/CyclomaticComplexity.js +0 -0
  463. /package/{out/main → main}/rules/DMLStatementInLoop.d.ts +0 -0
  464. /package/{out/main → main}/rules/DMLStatementInLoop.js +0 -0
  465. /package/{out/main → main}/rules/DuplicateDMLOperation.d.ts +0 -0
  466. /package/{out/main → main}/rules/DuplicateDMLOperation.js +0 -0
  467. /package/{out/main → main}/rules/FlowDescription.d.ts +0 -0
  468. /package/{out/main → main}/rules/FlowDescription.js +0 -0
  469. /package/{out/main → main}/rules/FlowName.d.ts +0 -0
  470. /package/{out/main → main}/rules/FlowName.js +0 -0
  471. /package/{out/main → main}/rules/GetRecordAllFields.d.ts +0 -0
  472. /package/{out/main → main}/rules/GetRecordAllFields.js +0 -0
  473. /package/{out/main → main}/rules/HardcodedId.d.ts +0 -0
  474. /package/{out/main → main}/rules/HardcodedId.js +0 -0
  475. /package/{out/main → main}/rules/HardcodedSecret.d.ts +0 -0
  476. /package/{out/main → main}/rules/HardcodedSecret.js +0 -0
  477. /package/{out/main → main}/rules/HardcodedUrl.d.ts +0 -0
  478. /package/{out/main → main}/rules/HardcodedUrl.js +0 -0
  479. /package/{out/main → main}/rules/InactiveFlow.d.ts +0 -0
  480. /package/{out/main → main}/rules/InactiveFlow.js +0 -0
  481. /package/{out/main → main}/rules/MissingFaultPath.d.ts +0 -0
  482. /package/{out/main → main}/rules/MissingFaultPath.js +0 -0
  483. /package/{out/main → main}/rules/MissingMetadataDescription.d.ts +0 -0
  484. /package/{out/main → main}/rules/MissingMetadataDescription.js +0 -0
  485. /package/{out/main → main}/rules/MissingNullHandler.d.ts +0 -0
  486. /package/{out/main → main}/rules/MissingNullHandler.js +0 -0
  487. /package/{out/main → main}/rules/MissingRecordTriggerFilter.d.ts +0 -0
  488. /package/{out/main → main}/rules/MissingRecordTriggerFilter.js +0 -0
  489. /package/{out/main → main}/rules/ProcessBuilder.d.ts +0 -0
  490. /package/{out/main → main}/rules/ProcessBuilder.js +0 -0
  491. /package/{out/main → main}/rules/RecordIdAsString.d.ts +0 -0
  492. /package/{out/main → main}/rules/RecordIdAsString.js +0 -0
  493. /package/{out/main → main}/rules/RecursiveAfterUpdate.d.ts +0 -0
  494. /package/{out/main → main}/rules/RecursiveAfterUpdate.js +0 -0
  495. /package/{out/main → main}/rules/SOQLQueryInLoop.d.ts +0 -0
  496. /package/{out/main → main}/rules/SOQLQueryInLoop.js +0 -0
  497. /package/{out/main → main}/rules/SameRecordFieldUpdates.d.ts +0 -0
  498. /package/{out/main → main}/rules/SameRecordFieldUpdates.js +0 -0
  499. /package/{out/main → main}/rules/TransformInsteadOfLoop.d.ts +0 -0
  500. /package/{out/main → main}/rules/TransformInsteadOfLoop.js +0 -0
  501. /package/{out/main → main}/rules/TriggerOrder.d.ts +0 -0
  502. /package/{out/main → main}/rules/TriggerOrder.js +0 -0
  503. /package/{out/main → main}/rules/UnconnectedElement.d.ts +0 -0
  504. /package/{out/main → main}/rules/UnconnectedElement.js +0 -0
  505. /package/{out/main → main}/rules/UnsafeRunningContext.d.ts +0 -0
  506. /package/{out/main → main}/rules/UnsafeRunningContext.js +0 -0
  507. /package/{out/main → main}/rules/UnusedVariable.d.ts +0 -0
  508. /package/{out/main → main}/rules/UnusedVariable.js +0 -0
package/README.md ADDED
@@ -0,0 +1,642 @@
1
+ <p align="center">
2
+ <a href="https://github.com/Flow-Scanner/lightning-flow-scanner/stargazers">
3
+ <img src="https://img.shields.io/github/stars/Flow-Scanner/lightning-flow-scanner?label=Stargazers&style=flat-square" alt="GitHub stars">
4
+ </a>
5
+ <a href="https://www.npmjs.com/package/@flow-scanner/lightning-flow-scanner-core">
6
+ <img src="https://img.shields.io/npm/v/@flow-scanner/lightning-flow-scanner-core?label=Core&style=flat-square" alt="Core version">
7
+ </a>
8
+ <a href="https://www.npmjs.com/package/lightning-flow-scanner">
9
+ <img src="https://img.shields.io/npm/v/lightning-flow-scanner?label=CLI&style=flat-square" alt="CLI version">
10
+ </a>
11
+ <a href="https://open-vsx.org/extension/ForceConfigControl/lightning-flow-scanner-vsx">
12
+ <img src="https://img.shields.io/open-vsx/v/ForceConfigControl/lightning-flow-scanner-vsx?label=VS%20Code&style=flat-square" alt="VS Code version">
13
+ </a>
14
+ <a href="https://www.npmjs.com/package/lightning-flow-scanner-core">
15
+ <img src="https://img.shields.io/npm/dt/lightning-flow-scanner-core?label=Downloads%3Cv6&style=flat-square" alt="Downloads <v6">
16
+ </a>
17
+ <a href="https://www.npmjs.com/package/@flow-scanner/lightning-flow-scanner-core">
18
+ <img src="https://img.shields.io/npm/dt/@flow-scanner/lightning-flow-scanner-core?label=Downloads%3Ev6&style=flat-square" alt="Downloads >v6">
19
+ </a>
20
+ </p>
21
+
22
+ <p align="center">
23
+ <a href="https://github.com/Flow-Scanner">
24
+ <img src="https://raw.githubusercontent.com/Flow-Scanner/Lightning-Flow-Scanner/main/docs/media/banner.png" alt="Lightning Flow Scanner" width="43%" />
25
+ </a>
26
+ </p>
27
+
28
+ <p align="center"><i>Detect unsafe contexts, queries in loops, hardcoded IDs, and more to optimize Salesforce Flows</i></p>
29
+
30
+ ---
31
+
32
+ ## Table of contents
33
+
34
+ - **[Default Rules](#default-rules)**
35
+ - [Problems](#problems)
36
+ - [Suggestions](#suggestions)
37
+ - [Layout](#layout)
38
+ - **[Configuration](#configuration)**
39
+ - [Configure Rules](#configure-rules)
40
+ - [Define Exceptions](#define-exceptions)
41
+ - [Exclude Flows](#exclude-flows)
42
+ - [Scan Modes](#scan-modes)
43
+ - **[Installation](#installation)**
44
+ - [Distributions](#distributions)
45
+ - [CICD Templates](#cicd-templates)
46
+ - **[Quick Start](#quick-start)**
47
+ - **[Development](#development)**
48
+
49
+ ---
50
+
51
+ ## Default Rules
52
+
53
+ <p>📌<strong>Tip:</strong> To link directly to a specific rule, use the full GitHub anchor link format. Example:</p>
54
+ <p><em><a href="https://flow-scanner.github.io/lightning-flow-scanner/#unsafe-running-context">https://flow-scanner.github.io/lightning-flow-scanner/#unsafe-running-context</a></em></p>
55
+
56
+ > Want to help improve this project? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=contributing-ov-file)
57
+
58
+ <!-- START GENERATED_RULES -->
59
+
60
+ ---
61
+
62
+ ### Problems
63
+
64
+ These rules detect anti-patterns and unsafe practices in your Flows that could break functionality, compromise security, or cause deployment failures.
65
+
66
+ #### DML Statement In A Loop
67
+ Executing DML operations (insert, update, delete) inside a loop is a high-risk anti-pattern that frequently causes governor limit exceptions. All database operations should be collected and executed once, outside the loop.
68
+
69
+ **Rule ID:** `dml-in-loop`
70
+ **Class Name:** _[DMLStatementInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DMLStatementInLoop.ts)_
71
+ **Severity:** 🔴 *Error*
72
+
73
+ #### Hardcoded Salesforce Id
74
+ Avoid hard-coding record IDs, as they are unique to a specific org and will not work in other environments. Instead, store IDs in variables—such as merge-field URL parameters or a **Get Records** element—to make the Flow portable, maintainable, and flexible.
75
+
76
+ **Rule ID:** `hardcoded-id`
77
+ **Class Name:** _[HardcodedId](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedId.ts)_
78
+ **Severity:** 🔴 *Error*
79
+
80
+ #### Hardcoded Salesforce Url
81
+ Avoid hard-coding URLs, as they may change between environments or over time. Instead, store URLs in variables or custom settings to make the Flow adaptable, maintainable, and environment-independent.
82
+
83
+ **Rule ID:** `hardcoded-url`
84
+ **Class Name:** _[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_
85
+ **Severity:** 🔴 *Error*
86
+
87
+ #### Hardcoded Secret ![Beta](https://img.shields.io/badge/status-beta-yellow)
88
+ Avoid hardcoding secrets, API keys, tokens, or credentials in Flows. These should be stored securely in Named Credentials, Custom Settings, Custom Metadata, or external secret management systems.
89
+
90
+ **Rule ID:** `hardcoded-secret`
91
+ **Class Name:** _[HardcodedSecret](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedSecret.ts)_
92
+ **Severity:** 🔴 *Error*
93
+
94
+ #### Process Builder
95
+ Process Builder is retired. Continuing to use it increases maintenance overhead and risks future compatibility issues. Migrating automation to Flow reduces risk and improves maintainability.
96
+
97
+ **Rule ID:** `process-builder-usage`
98
+ **Class Name:** _[ProcessBuilder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ProcessBuilder.ts)_
99
+ **Severity:** 🔴 *Error*
100
+
101
+ #### SOQL Query In A Loop
102
+ Running SOQL queries inside a loop can rapidly exceed query limits and severely degrade performance. Queries should be executed once, with results reused throughout the loop.
103
+
104
+ **Rule ID:** `soql-in-loop`
105
+ **Class Name:** _[SOQLQueryInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SOQLQueryInLoop.ts)_
106
+ **Severity:** 🔴 *Error*
107
+
108
+ #### Unsafe Running Context
109
+ Flows configured to run in System Mode without Sharing grant access to all data, bypassing user permissions. Avoid this setting to prevent security risks and protect sensitive data.
110
+
111
+ **Rule ID:** `unsafe-running-context`
112
+ **Class Name:** _[UnsafeRunningContext](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnsafeRunningContext.ts)_
113
+ **Severity:** 🔴 *Error*
114
+
115
+ #### Duplicate DML Operation
116
+ When a Flow performs database operations across multiple screens, users navigating backward can cause the same actions to run multiple times. To prevent unintended changes, either restrict backward navigation or redesign the Flow so database operations execute in a single, forward-moving step.
117
+
118
+ **Rule ID:** `duplicate-dml`
119
+ **Class Name:** _[DuplicateDMLOperation](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DuplicateDMLOperation.ts)_
120
+ **Severity:** 🟡 *Warning*
121
+
122
+ #### Missing Fault Path
123
+ Elements that can fail should include a Fault Path to handle errors gracefully. Without it, failures show generic errors to users. Fault Paths improve reliability and user experience.
124
+
125
+ **Rule ID:** `missing-fault-path`
126
+ **Class Name:** _[MissingFaultPath](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFaultPath.ts)_
127
+ **Severity:** 🟡 *Warning*
128
+
129
+ #### Missing Null Handler
130
+ Get Records operations return null when no data is found. Without handling these null values, Flows can fail or produce unintended results. Adding a null check improves reliability and ensures the Flow behaves as expected.
131
+
132
+ **Rule ID:** `missing-null-handler`
133
+ **Class Name:** _[MissingNullHandler](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingNullHandler.ts)_
134
+ **Severity:** 🟡 *Warning*
135
+
136
+ #### Recursive After Update
137
+ After-save Flows that update the same record can trigger recursion, causing unintended behavior or performance issues. Avoid updating the triggering record in after-save Flows; use before-save Flows instead to prevent recursion.
138
+
139
+ **Rule ID:** `recursive-record-update`
140
+ **Class Name:** _[RecursiveAfterUpdate](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecursiveAfterUpdate.ts)_
141
+ **Severity:** 🟡 *Warning*
142
+
143
+ ---
144
+
145
+ ### Suggestions
146
+
147
+ These rules highlight areas where Flows can be improved. Following them increases reliability and long-term maintainability.
148
+
149
+ #### Action Call In A Loop
150
+ Repeatedly invoking Apex actions inside a loop can exhaust governor limits and lead to performance issues. Where possible, bulkify your logic by moving the action call outside the loop and passing a collection variable instead.
151
+
152
+ **Rule ID:** `action-call-in-loop`
153
+ **Class Name:** _[ActionCallsInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ActionCallsInLoop.ts)_
154
+ **Severity:** 🟡 *Warning*
155
+
156
+ #### Get Record All Fields
157
+ Avoid using Get Records to retrieve all fields unless necessary. This improves performance, reduces processing time, and limits exposure of unnecessary data.
158
+
159
+ **Rule ID:** `get-record-all-fields`
160
+ **Class Name:** _[GetRecordAllFields](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/GetRecordAllFields.ts)_
161
+ **Severity:** 🟡 *Warning*
162
+
163
+ #### Inactive Flow
164
+ Inactive Flows should be deleted or archived to reduce risk. Even when inactive, they can cause unintended record changes during testing or be activated as subflows. Keeping only active, relevant Flows improves safety and maintainability.
165
+
166
+ **Rule ID:** `inactive-flow`
167
+ **Class Name:** _[InactiveFlow](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/InactiveFlow.ts)_
168
+ **Severity:** 🟡 *Warning*
169
+
170
+ #### Invalid API Version
171
+ Flows running on outdated API versions may behave inconsistently when newer platform features or components are used. From API version 50.0 onward, the API Version attribute explicitly controls Flow runtime behavior. Keeping Flows aligned with a supported API version helps prevent compatibility issues and ensures predictable execution.
172
+
173
+ **Rule ID:** `invalid-api-version`
174
+ **Class Name:** _[APIVersion](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/APIVersion.ts)_
175
+ **Severity:** 🟡 *Warning*
176
+
177
+ #### Missing Filter Record Trigger ![Beta](https://img.shields.io/badge/status-beta-yellow)
178
+ Record-triggered Flows without filters on changed fields or entry conditions execute on every record change. Adding filters ensures the Flow runs only when needed, improving performance.
179
+
180
+ **Rule ID:** `missing-record-trigger-filter`
181
+ **Class Name:** _[MissingFilterRecordTrigger](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFilterRecordTrigger.ts)_
182
+ **Severity:** 🟡 *Warning*
183
+
184
+ #### Same Record Field Updates
185
+ Before-save Flows can safely update the triggering record directly via $Record, applying changes efficiently without extra DML operations. Using before-save updates improves performance
186
+
187
+ **Rule ID:** `same-record-field-updates`
188
+ **Class Name:** _[SameRecordFieldUpdates](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SameRecordFieldUpdates.ts)_
189
+ **Severity:** 🟡 *Warning*
190
+
191
+ #### Excessive Cyclomatic Complexity
192
+ High numbers of loops and decision elements increase a Flow's cyclomatic complexity. To maintain simplicity and readability, consider using subflows or splitting a Flow into smaller, ordered Flows.
193
+
194
+ **Rule ID:** `excessive-cyclomatic-complexity`
195
+ **Class Name:** _[CyclomaticComplexity](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CyclomaticComplexity.ts)_
196
+ **Severity:** 🔵 *Note*
197
+
198
+ #### Missing Trigger Order
199
+ Record-triggered Flows without a specified Trigger Order may execute in an unpredictable sequence. Setting a Trigger Order ensures your Flows run in the intended order.
200
+
201
+ **Rule ID:** `unspecified-trigger-order`
202
+ **Class Name:** _[TriggerOrder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TriggerOrder.ts)_
203
+ **Severity:** 🔵 *Note*
204
+
205
+ #### Record ID as String ![Beta](https://img.shields.io/badge/status-beta-yellow)
206
+ Flows that use a String variable for a record ID instead of receiving the full record introduce unnecessary complexity and additional Get Records queries. Using the complete record simplifies the Flow and improves performance.
207
+
208
+ **Rule ID:** `record-id-as-string`
209
+ **Class Name:** _[RecordIdAsString](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecordIdAsString.ts)_
210
+ **Severity:** 🔵 *Note*
211
+
212
+ #### Transform Instead of Loop ![Beta](https://img.shields.io/badge/status-beta-yellow)
213
+ Loop elements that perform direct Assignments on each item can slow down Flows. Using Transform elements allows bulk operations on collections, improving performance and reducing complexity.
214
+
215
+ **Rule ID:** `transform-instead-of-loop`
216
+ **Class Name:** _[TransformInsteadOfLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TransformInsteadOfLoop.ts)_
217
+ **Severity:** 🔵 *Note*
218
+
219
+ ---
220
+
221
+ ### Layout
222
+
223
+ Focused on naming, documentation, and organization, these rules ensure Flows remain clear, easy to understand, and maintainable as automations grow.
224
+
225
+ #### Flow Naming Convention
226
+ Using clear and consistent Flow names improves readability, discoverability, and maintainability. A good naming convention helps team members quickly understand a Flow's purpose—for example, including a domain and brief description like Service_OrderFulfillment. Adopt a naming pattern that aligns with your organization's standards.
227
+
228
+ **Rule ID:** `invalid-naming-convention`
229
+ **Class Name:** _[FlowName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowName.ts)_
230
+ **Severity:** 🔴 *Error*
231
+
232
+ #### Missing Flow Description
233
+ Flow descriptions are essential for documentation and maintainability. Include a description for each Flow, explaining its purpose and where it's used.
234
+
235
+ **Rule ID:** `missing-flow-description`
236
+ **Class Name:** _[FlowDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowDescription.ts)_
237
+ **Severity:** 🔴 *Error*
238
+
239
+ #### Missing Metadata Description ![Beta](https://img.shields.io/badge/status-beta-yellow)
240
+ Elements and metadata without a description reduce clarity and maintainability. Adding descriptions improves readability and makes your automation easier to understand.
241
+
242
+ **Rule ID:** `missing-metadata-description`
243
+ **Class Name:** _[MissingMetadataDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingMetadataDescription.ts)_
244
+ **Severity:** 🟡 *Warning*
245
+
246
+ #### Unclear API Name
247
+ Elements with unclear or duplicated API names, like Copy_X_Of_Element, reduce Flow readability. Make sure to update the API name when copying elements to keep your Flow organized.
248
+
249
+ **Rule ID:** `unclear-api-naming`
250
+ **Class Name:** _[CopyAPIName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CopyAPIName.ts)_
251
+ **Severity:** 🟡 *Warning*
252
+
253
+ #### Unreachable Element
254
+ Unconnected elements never execute and add unnecessary clutter. Remove or connect unused Flow elements to keep Flows clean and efficient.
255
+
256
+ **Rule ID:** `unreachable-element`
257
+ **Class Name:** _[UnconnectedElement](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnconnectedElement.ts)_
258
+ **Severity:** 🟡 *Warning*
259
+
260
+ #### Unused Variable
261
+ Unused variables are never referenced and add unnecessary clutter. Remove them to keep Flows efficient and easy to maintain.
262
+
263
+ **Rule ID:** `unused-variable`
264
+ **Class Name:** _[UnusedVariable](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnusedVariable.ts)_
265
+ **Severity:** 🟡 *Warning*
266
+
267
+ #### Missing Auto Layout
268
+ Auto-Layout automatically arranges and aligns Flow elements, keeping the canvas organized and easier to maintain. Enabling it saves time and improves readability.
269
+
270
+ **Rule ID:** `missing-auto-layout`
271
+ **Class Name:** _[AutoLayout](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/AutoLayout.ts)_
272
+ **Severity:** 🔵 *Note*
273
+ <!-- END GENERATED_RULES -->
274
+
275
+ ---
276
+
277
+ ## Configuration
278
+
279
+ It is recommend to configure and define:
280
+
281
+ - The severity of violating any specific rule.
282
+ - Expressions used for rules, such as REGEX patterns and comparison operators.
283
+ - Any known exceptions that should be ignored during scanning.
284
+
285
+ ```json
286
+ {
287
+ "rules": {
288
+ // Your rule configurations
289
+ },
290
+ "exceptions": {
291
+ // Your defined exceptions
292
+ }
293
+ }
294
+ ```
295
+
296
+ Most Lightning Flow Scanner distributions automatically resolve configurations from `.flow-scanner.yml`, `.flow-scanner.json`, or `package.json` → `flowScanner`.
297
+
298
+ ### Configure Rules
299
+
300
+ By default, all default rules are executed. You can customize individual rules and override the rules to be executed without having to specify every rule. Below is a breakdown of the available attributes of rule configuration:
301
+
302
+ ```json
303
+ {
304
+ "rules": {
305
+ "<RuleId>": {
306
+ "severity": "<Severity>", // Override severity level
307
+ "expression": "<Expression>", // Override rule expression
308
+ "message": "<Message>", // Set custom message
309
+ "messageUrl": "<URL>", // Set custom documentation URL
310
+ "enabled": false, // Disable this rule
311
+ }
312
+ }
313
+ }
314
+ ```
315
+
316
+ #### Configure Severity
317
+
318
+ When the severity is not provided it will be `warning` by default. Other available values for severity are `error` and `note`. Configure the severity per rule as demonstrated below:
319
+
320
+ ```json
321
+ {
322
+ "rules": {
323
+ "record-id-as-string": {
324
+ "severity": "warning",
325
+ },
326
+ "unclear-api-naming": {
327
+ "severity": "error",
328
+ }
329
+ }
330
+ }
331
+ ```
332
+
333
+ #### Override Expressions
334
+
335
+ Some rules are configurable and allow overriding their default expressions. You configure these overrides the same way as severity, as shown in the examples below.
336
+
337
+ ```json
338
+ {
339
+ "rules": {
340
+ "invalid-api-version": {
341
+ "expression": "===58" // comparison expression
342
+ },
343
+ "invalid-naming-convention": {
344
+ "expression": "[A-Za-z0-9]" // regular expression
345
+ }
346
+ }
347
+ }
348
+ ```
349
+
350
+ #### Customize Messages
351
+
352
+ If not provided, `message` shows the standard rule summary and `messageUrl` links to the README; providing either overrides the default behavior.
353
+
354
+ ```json
355
+ {
356
+ "rules": {
357
+ "dml-in-loop": {
358
+ "message": "Avoid DML inside loops. Bulkify operations instead.",
359
+ "messageUrl": "https://internal.docs.company.com/salesforce/flow-dml-best-practices"
360
+ }
361
+ }
362
+ }
363
+ ```
364
+
365
+ #### Disable Rules
366
+
367
+ To disable a rule, set `"enabled": false` as shown below:
368
+
369
+ ```json
370
+ {
371
+ "rules": {
372
+ "dml-in-loop": {
373
+ "enabled": false
374
+ }
375
+ }
376
+ }
377
+ ```
378
+
379
+ ### Define Exceptions
380
+
381
+ Defining exceptions allows you to exclude specific scenarios from rule enforcement. Exceptions can be specified at the flow, rule, or result level to provide fine-grained control. Below is a breakdown of the available attributes of exception configuration:
382
+
383
+ ```json
384
+ {
385
+ "exceptions": {
386
+ "<FlowName>": {
387
+ "<RuleId>": [
388
+ "<ResultName>", // Suppress a result
389
+ "*", // Wildcard to suppress all results
390
+ ...
391
+ ]
392
+ },
393
+ ...
394
+ }
395
+ }
396
+ ```
397
+
398
+ _Example_
399
+
400
+ ```json
401
+ {
402
+ "exceptions": {
403
+ "MyFlow": {
404
+ "hardcoded-id": ["Old_Lookup_1"],
405
+ "missing-null-handler": ["*"]
406
+ }
407
+ }
408
+ }
409
+ ```
410
+
411
+ ### Exclude Flows
412
+
413
+ #### Exclude by File Path (Node.js only)
414
+
415
+ Use glob patterns to exclude flows based on their file system location. This is useful for excluding entire directories or specific name patterns:
416
+
417
+ ```json
418
+ {
419
+ "ignore": [
420
+ "**/testing/**",
421
+ "**/*_Deprecated.flow-meta.xml"
422
+ ]
423
+ }
424
+ ```
425
+
426
+ **Environment compatibility**: requires Node.js(file system access) and is not available when using the Core Library in browser/web environments.
427
+
428
+ #### Exclude by Flow API Name (Browser-compatible)
429
+
430
+ Exclude specific flows by their unique API names, regardless of their location. This is particularly useful for:
431
+ - Excluding specific flows without knowing their exact file path
432
+ - Working with metadata API deployments where directory structures may vary
433
+ - More precise control than path-based patterns
434
+
435
+ ```json
436
+ {
437
+ "ignoreFlows": [
438
+ "My_Legacy_Flow",
439
+ "Temporary_Test_Flow",
440
+ "Deprecated_Process_Builder"
441
+ ]
442
+ }
443
+ ```
444
+
445
+ **Environment compatibility**: works in **all environments** including Node.js and browser/web distributions, as it operates on parsed flow data rather than file system paths.
446
+
447
+ ### Scan Modes
448
+
449
+ #### Beta Mode
450
+
451
+ New rules are introduced in Beta mode before being added to the default ruleset. To include current Beta rules, enable the optional betamode parameter in your configuration:
452
+
453
+ ```json
454
+ { "betaMode": true }
455
+ ```
456
+
457
+ #### Rule Mode
458
+
459
+ By default, Lightning Flow Scanner runs **all** default rules and merges any custom configurations you provide. If instead, you want to run **only** the rules you explicitly specify, use:
460
+ ```json
461
+ { "ruleMode": "isolated" }
462
+ ```
463
+
464
+ ## Installation
465
+
466
+ ### Distributions
467
+
468
+ | Distribution | Best for | Install |
469
+ |----------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------|
470
+ | **[Salesforce CLI Plugin](https://www.npmjs.com/package/lightning-flow-scanner)** | Local development, scratch orgs, CI/CD | `sf plugins install lightning-flow-scanner` |
471
+ | **[VS Code Extension](https://open-vsx.org/extension/ForceConfigControl/lightning-flow-scanner-vsx)** | Real-time scanning inside VS Code | `code --install-extension ForceConfigControl.lightning-flow-scanner-vsx` |
472
+ | **[Salesforce App (Managed Package)](https://github.com/Flow-Scanner/lightning-flow-scanner-app)** | Run scans directly inside a Salesforce org | `sf package install --package 04tgK0000008CLlQAM` |
473
+ | **[GitHub Action](https://github.com/marketplace/actions/lightning-flow-scan)** | Native PR checks | `uses: Flow-Scanner/lightning-flow-scanner@main` |
474
+ | **[Core Library](https://www.npmjs.com/package/@flow-scanner/lightning-flow-scanner-core)** (Node.js + Browser) | Custom tools, scripts, extensions, web apps | `npm install -g @flow-scanner/lightning-flow-scanner-core` |
475
+
476
+ **Privacy:** Zero user data collected. All processing is client-side. → See our [Security Policy](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=security-ov-file).
477
+
478
+ ### CICD Templates
479
+ Ready-to-use CI/CD templates and a **Copado Plugin**.
480
+
481
+ | Platform | Type | Link |
482
+ |----------------|-----------------------------------|------|
483
+ | [Azure DevOps](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/azure-templates.md) | Full Project Scan | [`azure-pipelines-flow-FullScan.yml`](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/templates/azure-devops/azure-pipelines-flow-FullScan.yml) |
484
+ | [Azure DevOps](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/azure-templates.md) | Change-Based Scan | [`azure-pipelines-flow-changedFiles.yml`](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/templates/azure-devops/azure-pipelines-flow-changedFiles.yml) |
485
+ | **[Copado Plugin](https://github.com/Flow-Scanner/lightning-flow-scanner-copado)** | Copado Plugin | [Copado Marketplace](https://success.copado.com/s/listing-detail?language=en_US&recordId=a54P7000003G3gBIAS) |
486
+
487
+ ## Quick Start
488
+
489
+ ### Salesforce CLI Plugin
490
+
491
+ Use `lightning-flow-scanner` in the Salesforce CLI:
492
+
493
+ ```bash
494
+ sf flow:scan # Scan flows in the current directory
495
+ sf flow:scan --sarif > report.sarif # Export scan results as SARIF
496
+ sf flow scan --csv > results.csv # Export scan results as CSV
497
+ sf flow doc > flow-docs.md # Generate flow documentation (Single markdown file)
498
+ sf flow doc --output flow-docs --separate # Generate one Markdown file per flow
499
+ sf flow:fix -d src/force-app # Fix flows in a specific directory
500
+ ```
501
+
502
+ For full details, see the [CLI Readme](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/cli/README.md).
503
+
504
+ ### VS Code Extension
505
+ Use our side bar or the **Command Palette** and type `flow scanner` to see the list of all available commands.
506
+
507
+ * `Configure Scanner` - Set up rules in `.flow-scanner.yml`
508
+ * `Scan Flows` - Analyze a directory or selected flow files
509
+ * `Fix Flows` - Automatically apply available fixes
510
+ * `Generate Flow Documentation` - Generate flow documentation
511
+ * `Open Scanner Documentation` - Open the rules reference guide
512
+
513
+ For full details, see the [VSX Readme](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/vsx/README.md).
514
+
515
+ ### GitHub Action
516
+ Add a GitHub workflow file `.github/workflows/scan-flows.yml` to detect issues directly in pull requests:
517
+
518
+ ```yaml
519
+ - name: Lightning Flow Scan
520
+ id: flowscanner
521
+ uses: Flow-Scanner/lightning-flow-scanner@main
522
+ with:
523
+ sarif-only: true # Strict mode for PRs
524
+
525
+ - name: Upload SARIF to Code Scanning
526
+ uses: github/codeql-action/upload-sarif@v3
527
+ with:
528
+ sarif_file: ${{ steps.flowscanner.outputs.sarifPath }}
529
+ ```
530
+
531
+ For full details, see the [Action Readme](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/action/README.md).
532
+
533
+ ### Core Module
534
+ Use `lightning-flow-scanner-core` as a Node.js/browser dependency:
535
+
536
+ ```js
537
+ // Basic
538
+ import { parse, scan } from "@flow-scanner/lightning-flow-scanner-core";
539
+ parse("flows/*.xml").then(scan);
540
+
541
+ // Get SARIF output (e.g. for GitHub Code Scanning)
542
+ import { parse, scan, exportSarif } from "@flow-scanner/lightning-flow-scanner-core";
543
+ parse("flows/**/*.flow-meta.xml").then(scan).then(exportSarif)
544
+ // .then(sarif => fs.writeFile("results.sarif", sarif))
545
+
546
+ // Generate Markdown documentation with Mermaid flow diagrams
547
+ import { parse, exportDiagram } from "@flow-scanner/lightning-flow-scanner-core";
548
+ parse("flows/**/*.flow-meta.xml").then(exportDiagram)
549
+ // .then(md => fs.writeFile("flow-docs.md", md))
550
+
551
+ // Browser Usage (Tooling API)
552
+ const { Flow, scan } = window.lightningflowscanner;
553
+ const metadataRes = await conn.tooling.query(`SELECT Id, FullName, Metadata FROM Flow`);
554
+ const results = scan(
555
+ metadataRes.records.map((r) => ({
556
+ uri: `/services/data/v60.0/tooling/sobjects/Flow/${r.Id}`,
557
+ flow: new Flow(r.FullName, r.Metadata),
558
+ })) //, optionsForScan
559
+ );
560
+ ```
561
+
562
+ For more on Programmatic API, types, and advanced usage of `@flow-scanner/lightning-flow-scanner-core`, see the [Core Library Reference](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/core-reference.md).
563
+
564
+ ## Development
565
+
566
+ > This project optionally uses [Volta](https://volta.sh) to guarantee the exact same Node.js and tool versions for every contributor.
567
+ >
568
+ > MacOs/Linux:
569
+ > ```sh
570
+ > curl https://get.volta.sh | bash
571
+ > ```
572
+ > Windows:
573
+ > ```sh
574
+ > winget install Volta.Volta
575
+ > ```
576
+ > Volta will automatically install and lock the tool versions defined in `package.json`.
577
+
578
+ 1. Clone the repository
579
+
580
+ ```bash
581
+ git clone https://github.com/Flow-Scanner/lightning-flow-scanner.git
582
+ ```
583
+
584
+ 2. Install dependencies:
585
+
586
+ ```bash
587
+ pnpm install
588
+ ```
589
+
590
+ 3. Compile:
591
+
592
+ ```bash
593
+ pnpm run build
594
+ ```
595
+
596
+ To compile just the core package::
597
+ ```bash
598
+ pnpm build:core
599
+ ```
600
+
601
+ 4. Run tests:
602
+
603
+ ```bash
604
+ pnpm test
605
+ ```
606
+
607
+ Or to test a new version of the core:
608
+ ```bash
609
+ pnpm test:core
610
+ ```
611
+
612
+ 5. Linking the core module locally(Optional):
613
+
614
+ To link the module, run:
615
+
616
+ ```bash
617
+ pnpm link --global @flow-scanner/lightning-flow-scanner-core
618
+ ```
619
+
620
+ You can now do Ad-Hoc Testing with node:
621
+
622
+ ```bash
623
+ node -i -e "import('@flow-scanner/lightning-flow-scanner-core').then(m => { Object.assign(global, m.default ? m.default : m); console.log('✅ Core loaded! Try: await parse(...), scan(...), etc.'); })"
624
+ ```
625
+
626
+ Or test in a dependent project with `npm link @flow-scanner/lightning-flow-scanner-core`
627
+
628
+ 6. Deploy Demo Flows (Optional):
629
+
630
+ ```bash
631
+ cd example-flows && sf project deploy start
632
+ ```
633
+
634
+ Navigate to the [Demo Readme](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/example-flows/README.md) for full details
635
+
636
+ 7. Create a standalone UMD Module(Optional):
637
+
638
+ ```bash
639
+ pnpm dist
640
+ ```
641
+ This creates UMD at `dist/lightning-flow-scanner-core.umd.js`.
642
+