Genese complexity report

<- code-line.model.ts
Methods : 2
Complexity index : 16.2
Cyclomatic complexity : 10
Cognitive complexity
50 % Correct 1/2
50 % Warning 1/2 (threshold : 10)
0 % Error 0/2 (threshold : 20)
Cyclomatic complexity
50 % Correct 1/2
50 % Warning 1/2 (threshold : 5)
0 % Error 0/2 (threshold : 10)
Methods of code-line.model.ts
addComment Complexity Index 2.9 Cyclomatic complexity 1
                            
                                
                
            
            
                /**
                 * Add a comment at the end of a line of the code
                 * @param comment   // The comment to add
                 * @param maxLineLength
                 */
                addComment(comment: string, maxLineLength: number): void { // ----------------- +0.5 Complexity index (+0.5 atomic)
                    const txt = `${this.text} // `; // ---------------------------------------- +0.4 Complexity index (+0.4 atomic)
                    this.text = `${txt.padEnd(maxLineLength + 10, '-')} ${comment}`; // ------- +2.0 Complexity index (+1.0 atomic, +1 structural)
                }
            
                            
                        
setDepthAndNestingCpx Complexity Index 13.3 Cyclomatic complexity 9
                            
                                
                
            
            
                /**
                 * Sets the depth and nesting complexity to this CodeLine
                 */
                setDepthAndNestingCpx(): void { // --------------------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    this.cpxFactors.nesting = new NestingCpx(); // ----------------------------------------------------------------------- +0.6 Complexity index (+0.6 atomic)
                    this.cpxFactors.depth = new DepthCpx(); // --------------------------------------------------------------------------- +0.6 Complexity index (+0.6 atomic)
                    for (const astNode of this.astNodes) { // ---------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        if (astNode.intrinsicNestingCpx > 0) { // ------------------------------------------------------------------------ +2.0 Complexity index (+0.5 atomic, +0.5 nesting, +1 structural)
                            this.cpxFactors.depth = addObjects(this.cpxFactors.depth, astNode.cpxFactors?.depth); // --------------------- +2.1 Complexity index (+1.1 atomic, +1 structural)
                            this.cpxFactors.nesting = addObjects(this.cpxFactors.nesting, astNode.parent?.cpxFactors?.nesting); // ------- +2.2 Complexity index (+1.2 atomic, +1 structural)
                        }
                        if (astNode.intrinsicDepthCpx > 0) { // -------------------------------------------------------------------------- +2.0 Complexity index (+0.5 atomic, +0.5 nesting, +1 structural)
                            this.cpxFactors.depth = addObjects(this.cpxFactors.depth, astNode.parent?.cpxFactors?.depth); // ------------- +2.2 Complexity index (+1.2 atomic, +1 structural)
                        }
                    }
                }