Genese complexity report

<- reports.service.ts
Methods : 7
Complexity index : 30.5
Cyclomatic complexity : 9
Cognitive complexity
85.7 % Correct 6/7
14.3 % Warning 1/7 (threshold : 10)
0 % Error 0/7 (threshold : 20)
Cyclomatic complexity
100 % Correct 7/7
0 % Warning 0/7 (threshold : 5)
0 % Error 0/7 (threshold : 10)
Methods of reports.service.ts
generateAllReports Complexity Index 3.4 Cyclomatic complexity 1
                            
                                
            
            
                /**
                 * LanguageToJsonAst reports generation process
                 * @param jsonAst
                 */
                static generateAllReports(jsonAst: JsonAst): void { // --------------- +0.4 Complexity index (+0.4 atomic)
                    ReportsService.createStyleFiles(); // ---------------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                    const parentFolder: AstFolder = jsonAst.astFolder; // ------------ +0.5 Complexity index (+0.5 atomic)
                    ReportsService.generateSubfoldersReports(parentFolder); // ------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                }
            
                            
                        
generateMarkdownReports Complexity Index 2.6 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 * LanguageToJsonAst markdown reports generation process
                 * @param jsonAst
                 */
                static generateMarkdownReports(jsonAst: JsonAst): void { // ------------------------------- +0.4 Complexity index (+0.4 atomic)
                    const parentFolder: AstFolder = jsonAst.astFolder; // --------------------------------- +0.5 Complexity index (+0.5 atomic)
                    const folderMakdownReport = new AstFolderMarkdownReportService(parentFolder) // ------- +0.5 Complexity index (+0.5 atomic)
                    folderMakdownReport.generateReport(); // ---------------------------------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                }
            
                            
                        
generateConsoleReports Complexity Index 2.8 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 * LanguageToJsonAst console reports generation process
                 * @param jsonAst
                 */
                static generateConsoleReports(jsonAst: JsonAst): RowFileReport[] { // -------------------- +0.5 Complexity index (+0.5 atomic)
                    const parentFolder: AstFolder = jsonAst.astFolder; // -------------------------------- +0.5 Complexity index (+0.5 atomic)
                    const folderConsoleReport = new AstFolderConsoleReportService(parentFolder) // ------- +0.5 Complexity index (+0.5 atomic)
                    return folderConsoleReport.generateReport(); // -------------------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                }
            
                            
                        
generateSubfoldersReports Complexity Index 4.4 Cyclomatic complexity 2
                            
                                
                
            
            
                /**
                 * Generates reports of children recursively
                 * @param astFolder        // The AstFolder to analyse
                 */
                private static generateSubfoldersReports(astFolder: AstFolder): void{ // ------- +0.4 Complexity index (+0.4 atomic)
                    ReportsService.generateFolderReport(astFolder); // ------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    for (const subFolder of astFolder.children) { // --------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        ReportsService.generateSubfoldersReports(subFolder); // ---------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    }
                }
            
                            
                        
generateFolderReport Complexity Index 4.8 Cyclomatic complexity 2
                            
                                
                
            
            
                /**
                 * Generates a report for a given folder
                 * @param astFolder        // The AstFolder to analyse
                 */
                private static generateFolderReport(astFolder: AstFolder): void { // ------------ +0.4 Complexity index (+0.4 atomic)
                    const folderReportService = new AstFolderReportService(astFolder); // ------- +0.5 Complexity index (+0.5 atomic)
                    folderReportService.generateReport(); // ------------------------------------ +1.2 Complexity index (+0.2 atomic, +1 structural)
                    for (const file of astFolder.astFiles) { // --------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        ReportsService.generateFileReport(file); // ----------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    }
                }
            
                            
                        
generateFileReport Complexity Index 2.1 Cyclomatic complexity 1
                            
                                
                
            
            
                /**
                 * Generates a report for a given file
                 * @param astFile        // The AstFile to analyse
                 */
                private static generateFileReport(astFile: AstFile): void { // ------------ +0.4 Complexity index (+0.4 atomic)
                    const fileReportService = new AstFileReportService(astFile); // ------- +0.5 Complexity index (+0.5 atomic)
                    fileReportService.generateReport(); // -------------------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                }
            
                            
                        
createStyleFiles Complexity Index 10.4 Cyclomatic complexity 1
                            
                                
                
            
            
                /**
                 * Copy the css files, prism.js and chart.js to a subfolder of the outDir
                 */
                private static createStyleFiles(): void { // ----------------------------------------------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    createRelativeDir('reports-styles'); // ------------------------------------------------------------------------------------------------------------------ +1.2 Complexity index (+0.2 atomic, +1 structural)
                    copyFile(`${Options.pathGeneseNodeJs}/json-ast-to-reports/templates/styles/report.css`, `${Options.pathOutDir}/reports-styles/report.css`); // ----------- +1.5 Complexity index (+0.5 atomic, +1 structural)
                    copyFile(`${Options.pathGeneseNodeJs}/json-ast-to-reports/templates/styles/styles.css`, `${Options.pathOutDir}/reports-styles/styles.css`); // ----------- +1.5 Complexity index (+0.5 atomic, +1 structural)
                    copyFile(`${Options.pathGeneseNodeJs}/json-ast-to-reports/templates/styles/prettify.css`, `${Options.pathOutDir}/reports-styles/prettify.css`); // ------- +1.5 Complexity index (+0.5 atomic, +1 structural)
                    copyFile(`${Options.pathGeneseNodeJs}/json-ast-to-reports/templates/styles/prism.css`, `${Options.pathOutDir}/reports-styles/prism.css`); // ------------- +1.5 Complexity index (+0.5 atomic, +1 structural)
                    copyFile(`${Options.pathGeneseNodeJs}/json-ast-to-reports/templates/styles/prism.js`, `${Options.pathOutDir}/reports-styles/prism.js`); // --------------- +1.5 Complexity index (+0.5 atomic, +1 structural)
                    copyFile(`${Options.pathGeneseNodeJs}/core/chartjs/Chart.js`, `${Options.pathOutDir}/reports-styles/Chart.js`); // --------------------------------------- +1.5 Complexity index (+0.5 atomic, +1 structural)
                }