src/flow.ts
Function flow
has 295 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
Invalid
function flow(this: any, options: any) {
const seneca: any = this
seneca
.fix('sys:flow')
Function flow
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Invalid
Invalid
function flow(this: any, options: any) {
const seneca: any = this
seneca
.fix('sys:flow')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File flow.ts
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Invalid
Invalid
/* Copyright © 2022-2023 Richard Rodger and Seneca Project Contributors, MIT License. */
import { One, Child, Open, Skip } from 'gubu'
Function apply_step
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
Invalid
async function apply_step(
seneca: any,
flowDef: any,
stepDefs: any,
flowEnt: any,
Function msg_define_flowdef
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
Invalid
async function msg_define_flowdef(this: any, msg: any) {
let ok = true
let sysFlowDef = this.entity('sys/flowDef')
// NOTE: use name as id to ensure uniqueness
Function apply_step
has 6 arguments (exceeds 4 allowed). Consider refactoring. Invalid
Invalid
seneca: any,
flowDef: any,
stepDefs: any,
flowEnt: any,
flowData: any,