Genese complexity report

<- json-ast.model.ts
Methods : 2
Complexity index : 30.1
Cyclomatic complexity : 14
Cognitive complexity
50 % Correct 1/2
0 % Warning 0/2 (threshold : 10)
50 % Error 1/2 (threshold : 20)
Cyclomatic complexity
50 % Correct 1/2
50 % Warning 1/2 (threshold : 5)
0 % Error 0/2 (threshold : 10)
Methods of json-ast.model.ts
logg Complexity Index 21.3 Cyclomatic complexity 10
                            
                                
                
            
            
            
            
                // ---------------------------------------------------------------------------------
                //                                Other methods
                // ---------------------------------------------------------------------------------
            
            
                /**
                 * Logs the main information about the JsonAst
                 * @param message       // An 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 ?? 'JSON_AST')); // --------------------------------------------------------------------------------- +2.7 Complexity index (+0.7 atomic, +2 structural)
                    console.log(this.astFolder?.path); // ------------------------------------------------------------------------------------------------------ +1.5 Complexity index (+0.5 atomic, +1 structural)
                    console.log('-----------------------------'); // ------------------------------------------------------------------------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    for (const astFile of this.astFolder?.astFiles ?? []) { // --------------------------------------------------------------------------------- +1.6 Complexity index (+0.6 atomic, +1 structural)
                        console.log(chalk.blueBright('astFile'), astFile?.name); // ---------------------------------------------------------------------------- +2.7 Complexity index (+0.7 atomic, +2 structural)
                        console.log(chalk.blueBright('astFile astNode'), astFile?.astNode?.kind); // ----------------------------------------------------------- +2.8 Complexity index (+0.8 atomic, +2 structural)
                        console.log(chalk.blueBright('astFile children'), astFile?.astNode?.children); // ------------------------------------------------------ +2.8 Complexity index (+0.8 atomic, +2 structural)
                        this.loggChildren(astFile.astNode); // ------------------------------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                    }
                    console.log(chalk.blueBright('children'), this.astFolder?.children); // -------------------------------------------------------------------- +2.8 Complexity index (+0.8 atomic, +2 structural)
                }
            
                            
                        
loggChildren Complexity Index 8.8 Cyclomatic complexity 4
                            
                                
                
            
            
                /**
                 * Logs the main information of an AstNode of the JsonAst
                 * @param astNode       // The AstNode to analyse
                 * @param indent        // The current indentation in the log
                 */
                private loggChildren(astNode: AstNode, indent = ''): void { // ---------------------------- +2.6 Complexity index (+0.6 atomic, +2 recursivity)
                    for (const childAstNode of astNode?.children) { // ------------------------------------ +1.4 Complexity index (+0.4 atomic, +1 structural)
                        const name = childAstNode?.name ?? ''; // ----------------------------------------- +0.6 Complexity index (+0.6 atomic)
                        console.log(chalk.blueBright(`${indent}node`), childAstNode.kind, name); // ------- +2.8 Complexity index (+0.8 atomic, +2 structural)
                        this.loggChildren(childAstNode, `${indent}  `) // --------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                    }
                }