Genese complexity report

<- ternary-expression.ts
Methods : 2
Complexity index : 30.8
Cyclomatic complexity : 8
Cognitive complexity
0 % Correct 0/2
100 % Warning 2/2 (threshold : 10)
0 % Error 0/2 (threshold : 20)
Cyclomatic complexity
100 % Correct 2/2
0 % Warning 0/2 (threshold : 5)
0 % Error 0/2 (threshold : 10)
Methods of ternary-expression.ts
run Complexity Index 15.8 Cyclomatic complexity 4
                            
                                
            
            
            // @ts-ignore
            export function run(cstNode: TernaryExpression, children: TernaryExpressionChildren): any { // ------- +0.6 Complexity index (+0.6 atomic)
                const binaryExpressions = children.binaryExpression; // ------------------------------------------ +0.4 Complexity index (+0.4 atomic)
                const expression = children.expression; // ------------------------------------------------------- +0.4 Complexity index (+0.4 atomic)
                const expressionAst = [].concat(...expression?.map(e => cstToAst(e)) ?? []) // ------------------- +5.0 Complexity index (+1.0 atomic, +4 structural)
                if (children.QuestionMark) { // ------------------------------------------------------------------ +1.3 Complexity index (+0.3 atomic, +1 structural)
                    return questionMarkCase(expressionAst, children, binaryExpressions); // ---------------------- +1.5 Complexity index (+0.5 atomic, +1 structural)
                } else { // -------------------------------------------------------------------------------------- +1.1 Complexity index (+0.1 atomic, +1 structural)
                    return [ // ---------------------------------------------------------------------------------- +0.1 Complexity index (+0.1 atomic)
                        ...[].concat(...binaryExpressions?.map(e => cstToAst(e)) ?? []), // ---------------------- +5.3 Complexity index (+0.8 atomic, +0.5 nesting, +4 structural)
                        ...expressionAst // ---------------------------------------------------------------------- +0.1 Complexity index (+0.1 atomic)
                    ];
                }
            }
            
                            
                        
questionMarkCase Complexity Index 15 Cyclomatic complexity 4
                            
                                
            
            
            function questionMarkCase(expressionAst, children, binaryExpressions) { // ------------------ +0.4 Complexity index (+0.4 atomic)
                return { // ----------------------------------------------------------------------------- +0.1 Complexity index (+0.1 atomic)
                    kind: 'ConditionalExpression', // --------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    start: expressionAst[0].start, // --------------------------------------------------- +0.4 Complexity index (+0.4 atomic)
                    end: expressionAst[1].end, // ------------------------------------------------------- +0.4 Complexity index (+0.4 atomic)
                    pos: expressionAst[0].pos, // ------------------------------------------------------- +0.4 Complexity index (+0.4 atomic)
                    children: [ // ---------------------------------------------------------------------- +0.1 Complexity index (+0.1 atomic)
                        ...[].concat(...binaryExpressions?.map(e => cstToAst(e)) ?? []), // ------------- +4.8 Complexity index (+0.8 atomic, +4 structural)
                        ...children.QuestionMark?.map(e => cstToAst(e, 'questionMark')) ?? [], // ------- +3.9 Complexity index (+0.9 atomic, +3 structural)
                        expressionAst[0], // ------------------------------------------------------------ +0.2 Complexity index (+0.2 atomic)
                        ...children.Colon?.map(e => cstToAst(e, 'colonToken')) ?? [], // ---------------- +3.9 Complexity index (+0.9 atomic, +3 structural)
                        expressionAst[1] // ------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    ]
                }
            }