Genese complexity report

<- ast-file.model.ts
Methods : 3
Complexity index : 47.6
Cyclomatic complexity : 15
Cognitive complexity
33.3 % Correct 1/3
66.7 % Warning 2/3 (threshold : 10)
0 % Error 0/3 (threshold : 20)
Cyclomatic complexity
66.7 % Correct 2/3
33.3 % Warning 1/3 (threshold : 5)
0 % Error 0/3 (threshold : 10)
Methods of ast-file.model.ts
evaluate Complexity Index 9.4 Cyclomatic complexity 2
                            
                                
                
            
            
                // ---------------------------------------------------------------------------------
                //                                  Other methods
                // ---------------------------------------------------------------------------------
            
            
                /**
                 * Evaluates the complexities of the AstNodes and the AstMethods of this AstFile
                 */
                evaluate(): void { // -------------------------------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    this.cpxFactors = new CpxFactors(); // ----------------------------------------------------------------------------- +0.5 Complexity index (+0.5 atomic)
                    const astMethodService = new AstMethodService(); // ---------------------------------------------------------------- +0.4 Complexity index (+0.4 atomic)
                    this.astNode.evaluate(); // ---------------------------------------------------------------------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    for (const method of this.astMethods) { // ------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        method.evaluate(); // ------------------------------------------------------------------------------------------ +1.2 Complexity index (+0.2 atomic, +1 structural)
                        this.cpxFactors = this.cpxFactors.add(method.cpxFactors); // --------------------------------------------------- +1.8 Complexity index (+0.8 atomic, +1 structural)
                        this.cyclomaticCpx = this.cyclomaticCpx + method.cyclomaticCpx; // --------------------------------------------- +0.8 Complexity index (+0.8 atomic)
                        this.complexitiesByStatus = astMethodService.addMethodCpxByStatus(this.complexitiesByStatus, method); // ------- +1.8 Complexity index (+0.8 atomic, +1 structural)
                    }
                }
            
                            
                        
evaluateStandalone Complexity Index 20.1 Cyclomatic complexity 10
                            
                                
                
            
            
                /**
                 * Evaluates the complexities of the AstNodes of this AstFile
                 * But not based on methods
                 */
                evaluateStandalone(): void { // ---------------------------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    this.astMethods = []; // ------------------------------------------------------------------------------------------------- +0.3 Complexity index (+0.3 atomic)
                    this.cpxFactors = new CpxFactors(); // ----------------------------------------------------------------------------------- +0.5 Complexity index (+0.5 atomic)
                    this.astNode.evaluate(); // ---------------------------------------------------------------------------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    for (const node of this.astNodes) { // ----------------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        node.cpxFactors.nesting = new NestingCpx(); // ----------------------------------------------------------------------- +0.6 Complexity index (+0.6 atomic)
                        node.cpxFactors.depth = new DepthCpx(); // --------------------------------------------------------------------------- +0.6 Complexity index (+0.6 atomic)
                        for (const astNode of node.children) { // ---------------------------------------------------------------------------- +1.9 Complexity index (+0.4 atomic, +0.5 nesting, +1 structural)
                            if (astNode.intrinsicNestingCpx > 0) { // ------------------------------------------------------------------------ +2.5 Complexity index (+0.5 atomic, +1 nesting, +1 structural)
                                node.cpxFactors.depth = addObjects(this.cpxFactors.depth, astNode.cpxFactors?.depth); // --------------------- +2.1 Complexity index (+1.1 atomic, +1 structural)
                                node.cpxFactors.nesting = addObjects(this.cpxFactors.nesting, astNode.parent?.cpxFactors?.nesting); // ------- +2.2 Complexity index (+1.2 atomic, +1 structural)
                            }
                            if (astNode.intrinsicDepthCpx > 0) { // -------------------------------------------------------------------------- +2.5 Complexity index (+0.5 atomic, +1 nesting, +1 structural)
                                node.cpxFactors.depth = addObjects(this.cpxFactors.depth, astNode.parent?.cpxFactors?.depth); // ------------- +2.2 Complexity index (+1.2 atomic, +1 structural)
                            }
                        }
            
                        this.cpxFactors = this.cpxFactors.add(node.cpxFactors); // ----------------------------------------------------------- +1.8 Complexity index (+0.8 atomic, +1 structural)
                    }
                }
            
                            
                        
logg Complexity Index 18.1 Cyclomatic complexity 3
                            
                                
                
            
            
                /**
                 * Logs the main elements of an AstFile
                 * @param message       // Optional message
                 */
                logg(message?: string): void { // ------------------------------------------------ +0.4 Complexity index (+0.4 atomic)
                    console.log('-----------------------------'); // ----------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    console.log(chalk.yellowBright(message ?? 'AST_FILE')); // ------------------- +2.7 Complexity index (+0.7 atomic, +2 structural)
                    console.log(this.name); // --------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                    console.log('-----------------------------'); // ----------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    console.log(chalk.blueBright('end :'), this.end); // ------------------------- +2.7 Complexity index (+0.7 atomic, +2 structural)
                    console.log(chalk.blueBright('text :'), this.text); // ----------------------- +2.7 Complexity index (+0.7 atomic, +2 structural)
                    console.log(chalk.blueBright('astNode :'), this.astNode?.kind); // ----------- +2.8 Complexity index (+0.8 atomic, +2 structural)
                    console.log(chalk.blueBright('astFolder :'), this.astFolder?.path); // ------- +2.8 Complexity index (+0.8 atomic, +2 structural)
                }