/**
* Generates the folder's report
*/
generateReport(): void { // ---------------------------------------------------------------------------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
const parentFolder: AstFolder = new AstFolder(); // ------------------------------------------------------------------------------------------------------------------ +0.5 Complexity index (+0.5 atomic)
parentFolder.children.push(this.astFolder); // ----------------------------------------------------------------------------------------------------------------------- +1.5 Complexity index (+0.5 atomic, +1 structural)
this.relativeRootReports = getRouteToRoot(this.astFolder.relativePath); // ------------------------------------------------------------------------------------------- +1.7 Complexity index (+0.7 atomic, +1 structural)
this.filesArray = this.getFilesArray(this.astFolder); // ------------------------------------------------------------------------------------------------------------- +1.7 Complexity index (+0.7 atomic, +1 structural)
this.foldersArray = this.getFoldersArray(parentFolder); // ----------------------------------------------------------------------------------------------------------- +1.6 Complexity index (+0.6 atomic, +1 structural)
this.methodsArray = this.getMethodsArraySortedByDecreasingCognitiveCpx(parentFolder); // ----------------------------------------------------------------------------- +1.6 Complexity index (+0.6 atomic, +1 structural)
this.registerPartial("cognitiveBarchartScript", 'cognitive-barchart'); // -------------------------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
this.registerPartial("cyclomaticBarchartScript", 'cyclomatic-barchart'); // ------------------------------------------------------------------------------------------ +1.4 Complexity index (+0.4 atomic, +1 structural)
this.registerPartial("cognitiveDoughnutScript", 'cognitive-doughnut'); // -------------------------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
this.registerPartial("cyclomaticDoughnutScript", 'cyclomatic-doughnut'); // ------------------------------------------------------------------------------------------ +1.4 Complexity index (+0.4 atomic, +1 structural)
this.registerPartial("rowFolder", 'row-folders'); // ----------------------------------------------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
this.registerPartial("rowFile", 'row-files'); // --------------------------------------------------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
const reportTemplate = eol.auto(fs.readFileSync(`${Options.pathGeneseNodeJs}/json-ast-to-reports/templates/handlebars/folder-report.handlebars`, 'utf-8')); // ------- +2.9 Complexity index (+0.9 atomic, +2 structural)
this.template = Handlebars.compile(reportTemplate); // --------------------------------------------------------------------------------------------------------------- +1.6 Complexity index (+0.6 atomic, +1 structural)
this.writeReport(); // ----------------------------------------------------------------------------------------------------------------------------------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
}
|