private void generateSummarySection()

in src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReportGenerator.java [187:378]


    private void generateSummarySection( Locale locale, LinkcheckModel linkcheckModel, Sink sink )
    {
        // CHECKSTYLE_OFF: LineLength
        // Calculus
        List linkcheckFiles = linkcheckModel.getFiles();

        int totalFiles = linkcheckFiles.size();

        int totalLinks = 0;
        int totalValidLinks = 0;
        int totalErrorLinks = 0;
        int totalWarningLinks = 0;
        for ( Object linkcheckFile1 : linkcheckFiles )
        {
            LinkcheckFile linkcheckFile = (LinkcheckFile) linkcheckFile1;

            totalLinks += linkcheckFile.getNumberOfLinks();
            totalValidLinks += linkcheckFile.getNumberOfLinks( LinkcheckFileResult.VALID_LEVEL );
            totalErrorLinks += linkcheckFile.getNumberOfLinks( LinkcheckFileResult.ERROR_LEVEL );
            totalWarningLinks += linkcheckFile.getNumberOfLinks( LinkcheckFileResult.WARNING_LEVEL );
        }

        sink.section1();
        sink.sectionTitle1();
        sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary" ) );
        sink.sectionTitle1_();

        // Summary of the analysis parameters
        sink.paragraph();
        sink.rawText( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.overview1" ) );
        sink.paragraph_();

        sink.table();

        sink.tableRow();
        sink.tableHeaderCell();
        sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.parameter" ) );
        sink.tableHeaderCell_();
        sink.tableHeaderCell();
        sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.value" ) );
        sink.tableHeaderCell_();
        sink.tableRow_();

        sink.tableRow();
        sink.tableCell();
        sink.rawText( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.httpFollowRedirect" ) );
        sink.tableCell_();
        sink.tableCell();
        sink.text( String.valueOf( httpFollowRedirect ) );
        sink.tableCell_();
        sink.tableRow_();

        sink.tableRow();
        sink.tableCell();
        sink.rawText( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.httpMethod" ) );
        sink.tableCell_();
        sink.tableCell();
        if ( httpMethod == null || httpMethod.isEmpty() )
        {
            sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.none" ) );
        }
        else
        {
            sink.text( httpMethod );
        }
        sink.tableCell_();
        sink.tableRow_();

        sink.tableRow();
        sink.tableCell();
        sink.rawText( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.offline" ) );
        sink.tableCell_();
        sink.tableCell();
        sink.text( String.valueOf( offline ) );
        sink.tableCell_();
        sink.tableRow_();

        sink.tableRow();
        sink.tableCell();
        sink.rawText( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.excludedPages" ) );
        sink.tableCell_();
        sink.tableCell();
        if ( excludedPages == null || excludedPages.length == 0 )
        {
            sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.none" ) );
        }
        else
        {
            sink.text( StringUtils.join( excludedPages, "," ) );
        }
        sink.tableCell_();
        sink.tableRow_();

        sink.tableRow();
        sink.tableCell();
        sink.rawText( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.excludedLinks" ) );
        sink.tableCell_();
        sink.tableCell();
        if ( excludedLinks == null || excludedLinks.length == 0 )
        {
            sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.none" ) );
        }
        else
        {
            sink.text( StringUtils.join( excludedLinks, "," ) );
        }
        sink.tableCell_();
        sink.tableRow_();

        sink.tableRow();
        sink.tableCell();
        sink.rawText( i18n.getString( "linkcheck-report", locale,
                                      "report.linkcheck.summary.table.excludedHttpStatusErrors" ) );
        sink.tableCell_();
        sink.tableCell();
        if ( excludedHttpStatusErrors == null || excludedHttpStatusErrors.length == 0 )
        {
            sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.none" ) );
        }
        else
        {
            sink.text( toString( excludedHttpStatusErrors ) );
        }
        sink.tableCell_();
        sink.tableRow_();

        sink.tableRow();
        sink.tableCell();
        sink.rawText( i18n.getString( "linkcheck-report", locale,
                                      "report.linkcheck.summary.table.excludedHttpStatusWarnings" ) );
        sink.tableCell_();
        sink.tableCell();
        if ( excludedHttpStatusWarnings == null || excludedHttpStatusWarnings.length == 0 )
        {
            sink.text( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.table.none" ) );
        }
        else
        {
            sink.text( toString( excludedHttpStatusWarnings ) );
        }
        sink.tableCell_();
        sink.tableRow_();

        sink.table_();

        // Summary of the checked files
        sink.paragraph();
        sink.rawText( i18n.getString( "linkcheck-report", locale, "report.linkcheck.summary.overview2" ) );
        sink.paragraph_();

        sink.table();

        // Header
        generateTableHeader( locale, false, sink );

        // Content
        sink.tableRow();

        sink.tableCell();
        sink.bold();
        sink.text( totalFiles + "" );
        sink.bold_();
        sink.tableCell_();
        sink.tableCell();
        sink.bold();
        sink.text( totalLinks + "" );
        sink.bold_();
        sink.tableCell_();
        sink.tableCell();
        sink.bold();
        sink.text( String.valueOf( totalValidLinks ) );
        sink.bold_();
        sink.tableCell_();
        sink.tableCell();
        sink.bold();
        sink.text( String.valueOf( totalWarningLinks ) );
        sink.bold_();
        sink.tableCell_();
        sink.tableCell();
        sink.bold();
        sink.text( String.valueOf( totalErrorLinks ) );
        sink.bold_();
        sink.tableCell_();

        sink.tableRow_();

        sink.table_();

        sink.section1_();
        // CHECKSTYLE_ON: LineLength

    }