public void addScopeAnalysisToReport()

in reports/src/main/java/nl/obren/sokrates/reports/generators/statichtml/OverviewReportGenerator.java [35:85]


    public void addScopeAnalysisToReport(RichTextReport report) {
        appendHeader(report);

        String mainName = codeAnalysisResults.getCodeConfiguration().getMain().getName();
        String testName = codeAnalysisResults.getCodeConfiguration().getTest().getName();
        String generatedName = codeAnalysisResults.getCodeConfiguration().getGenerated().getName();
        String buildName = codeAnalysisResults.getCodeConfiguration().getBuildAndDeployment().getName();
        String otherName = codeAnalysisResults.getCodeConfiguration().getOther().getName();

        List<NumericMetric> code = Arrays.asList(new NumericMetric(mainName, codeAnalysisResults.getMainAspectAnalysisResults().getLinesOfCode()),
                new NumericMetric(testName, codeAnalysisResults.getTestAspectAnalysisResults().getLinesOfCode()),
                new NumericMetric(generatedName, codeAnalysisResults.getGeneratedAspectAnalysisResults().getLinesOfCode()),
                new NumericMetric(buildName, codeAnalysisResults.getBuildAndDeployAspectAnalysisResults().getLinesOfCode()),
                new NumericMetric(otherName, codeAnalysisResults.getOtherAspectAnalysisResults().getLinesOfCode()));

        List<NumericMetric> counts = Arrays.asList(new NumericMetric(mainName,
                        codeAnalysisResults.getMainAspectAnalysisResults().getFilesCount()),
                new NumericMetric(testName, codeAnalysisResults.getTestAspectAnalysisResults().getFilesCount()),
                new NumericMetric(generatedName, codeAnalysisResults.getGeneratedAspectAnalysisResults().getFilesCount()),
                new NumericMetric(buildName, codeAnalysisResults.getBuildAndDeployAspectAnalysisResults().getFilesCount()),
                new NumericMetric(otherName, codeAnalysisResults.getOtherAspectAnalysisResults().getFilesCount()));

        List<AspectAnalysisResults> aspects = Arrays.asList(codeAnalysisResults.getMainAspectAnalysisResults(),
                codeAnalysisResults.getTestAspectAnalysisResults(),
                codeAnalysisResults.getGeneratedAspectAnalysisResults(),
                codeAnalysisResults.getBuildAndDeployAspectAnalysisResults(),
                codeAnalysisResults.getOtherAspectAnalysisResults());

        report.startSection("Overview of Analyzed Files", "Basic stats on analyzed files");
        report.startSubSection("Intro", "For analysis purposes we separate files in scope into several categories: <b>main</b>, <b>test</b>, <b>generated</b>, <b>deployment and build</b>, and <b>other</b>.");
        appendIntroduction(report);
        ScopesRenderer renderer = getScopesRenderer("", "", counts, code);
        renderer.setInSection(false);
        renderer.setTitle("All Files in Scope");
        renderer.setAspectsFileListPaths(aspects.stream().map(aspect -> aspect.getAspect().getFileSystemFriendlyName("")).collect(Collectors.toList()));
        renderer.renderReport(report, "");

        report.endSection();

        renderScopes(report, codeAnalysisResults.getMainAspectAnalysisResults(), "Main Code", "All <b>manually</b> created or maintained source code that defines logic of the product that is  run in a <b>production</b> environment.");
        renderScopes(report, codeAnalysisResults.getTestAspectAnalysisResults(), "Test Code", "Used only for testing of the product. Normally not deployed in a production environment.");
        renderScopes(report, codeAnalysisResults.getGeneratedAspectAnalysisResults(), "Generated Code", "Automatically generated files, not manually changed after generation.");
        renderScopes(report, codeAnalysisResults.getBuildAndDeployAspectAnalysisResults(), "Build and Deployment Code", "Source code used to configure or support build and deployment process.");
        renderScopes(report, codeAnalysisResults.getOtherAspectAnalysisResults(), "Other Code", "");

        report.endSection();

        renderAnalyzersInfo(report, codeAnalysisResults);

        addFooter(report);
    }