Search in sources :

Example 1 with ReportWriter

use of com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter in project hub-detect by blackducksoftware.

the class DiagnosticReportHandler method detectorsProfiled.

private void detectorsProfiled(DetectorTimings detectorTimings) {
    try {
        final ReportWriter profileWriter = getReportWriter(ReportTypes.DETECTOR_PROFILE);
        final ProfilingReporter reporter = new ProfilingReporter();
        reporter.writeReport(profileWriter, detectorTimings);
    } catch (final Exception e) {
        logger.error("Failed to write profiling report.", e);
    }
}
Also used : FileReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.FileReportWriter) ReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter) InfoLogReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter) ProfilingReporter(com.blackducksoftware.integration.hub.detect.workflow.report.ProfilingReporter)

Example 2 with ReportWriter

use of com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter in project hub-detect by blackducksoftware.

the class DiagnosticReportHandler method completedCodeLocations.

public void completedCodeLocations(final Map<DetectCodeLocation, String> codeLocationNameMap) {
    if (completedDetectorEvaluations == null)
        return;
    try {
        final ReportWriter clWriter = getReportWriter(ReportTypes.CODE_LOCATIONS);
        final ReportWriter dcWriter = getReportWriter(ReportTypes.DEPENDENCY_COUNTS);
        final CodeLocationReporter clReporter = new CodeLocationReporter();
        clReporter.writeCodeLocationReport(clWriter, dcWriter, completedDetectorEvaluations, codeLocationNameMap);
    } catch (final Exception e) {
        logger.error("Failed to write code location report.", e);
    }
}
Also used : FileReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.FileReportWriter) ReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter) InfoLogReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter) CodeLocationReporter(com.blackducksoftware.integration.hub.detect.workflow.report.CodeLocationReporter)

Example 3 with ReportWriter

use of com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter in project hub-detect by blackducksoftware.

the class DiagnosticReportHandler method configurationsReport.

public void configurationsReport(DetectInfo detectInfo, List<DetectOption> detectOptions) {
    try {
        final ReportWriter profileWriter = getReportWriter(ReportTypes.CONFIGURATION);
        final ConfigurationReporter reporter = new ConfigurationReporter();
        reporter.writeReport(profileWriter, detectInfo, detectOptions);
    } catch (final Exception e) {
        logger.error("Failed to write profiling report.", e);
    }
}
Also used : FileReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.FileReportWriter) ReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter) InfoLogReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter) ConfigurationReporter(com.blackducksoftware.integration.hub.detect.workflow.report.ConfigurationReporter)

Example 4 with ReportWriter

use of com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter in project hub-detect by blackducksoftware.

the class DetectConfigurationReporter method printWarnings.

public void printWarnings(ReportWriter writer, final List<DetectOption> detectOptions) {
    final List<DetectOption> sortedOptions = sortOptions(detectOptions);
    final List<DetectOption> allWarnings = sortedOptions.stream().filter(it -> it.getWarnings().size() > 0).collect(Collectors.toList());
    if (allWarnings.size() > 0) {
        writer.writeLine("");
        writer.writeLine(StringUtils.repeat("*", 60));
        if (allWarnings.size() == 1) {
            writer.writeLine("WARNING (" + allWarnings.size() + ")");
        } else {
            writer.writeLine("WARNINGS (" + allWarnings.size() + ")");
        }
        for (final DetectOption option : allWarnings) {
            for (final String warning : option.getWarnings()) {
                writer.writeLine(option.getDetectProperty().getPropertyKey() + ": " + warning);
            }
        }
        writer.writeLine(StringUtils.repeat("*", 60));
        writer.writeLine("");
    }
}
Also used : DetectOption(com.blackducksoftware.integration.hub.detect.help.DetectOption) ReportWriter(com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter) List(java.util.List) DetectOption(com.blackducksoftware.integration.hub.detect.help.DetectOption) Collectors(java.util.stream.Collectors) StringUtils(org.apache.commons.lang3.StringUtils)

Aggregations

ReportWriter (com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter)4 FileReportWriter (com.blackducksoftware.integration.hub.detect.workflow.report.writer.FileReportWriter)3 InfoLogReportWriter (com.blackducksoftware.integration.hub.detect.workflow.report.writer.InfoLogReportWriter)3 DetectOption (com.blackducksoftware.integration.hub.detect.help.DetectOption)1 CodeLocationReporter (com.blackducksoftware.integration.hub.detect.workflow.report.CodeLocationReporter)1 ConfigurationReporter (com.blackducksoftware.integration.hub.detect.workflow.report.ConfigurationReporter)1 ProfilingReporter (com.blackducksoftware.integration.hub.detect.workflow.report.ProfilingReporter)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 StringUtils (org.apache.commons.lang3.StringUtils)1