Search in sources :

Example 1 with ReportWriter

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

the class DiagnosticReportHandler method configurationsReport.

public void configurationsReport(DetectInfo detectInfo, PropertyConfiguration propertyConfiguration, SortedMap<String, String> maskedRawPropertyValues) {
    try {
        ReportWriter profileWriter = getReportWriter(ReportTypes.CONFIGURATION);
        ConfigurationReporter reporter = new ConfigurationReporter();
        reporter.writeReport(profileWriter, detectInfo, propertyConfiguration, maskedRawPropertyValues);
    } catch (Exception e) {
        logger.error("Failed to write profiling report.", e);
    }
}
Also used : ReportWriter(com.synopsys.integration.detect.workflow.report.writer.ReportWriter) FileReportWriter(com.synopsys.integration.detect.workflow.report.writer.FileReportWriter) InfoLogReportWriter(com.synopsys.integration.detect.workflow.report.writer.InfoLogReportWriter) ConfigurationReporter(com.synopsys.integration.detect.workflow.report.ConfigurationReporter)

Example 2 with ReportWriter

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

the class DiagnosticReportHandler method completedCodeLocations.

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

Example 3 with ReportWriter

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

the class DiagnosticReportHandler method detectorsProfiled.

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

Example 4 with ReportWriter

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

the class PreparationSummaryReporter method writeSummary.

private void writeSummary(ReportWriter writer, List<DetectorEvaluationTree> detectorEvaluationTrees) {
    List<String> lines = new ArrayList<>();
    for (DetectorEvaluationTree detectorEvaluationTree : detectorEvaluationTrees) {
        List<DetectorEvaluation> applicable = DetectorEvaluationUtils.applicableChildren(detectorEvaluationTree);
        List<DetectorEvaluation> ready = applicable.stream().filter(DetectorEvaluation::isExtractable).collect(Collectors.toList());
        List<DetectorEvaluation> notExtractable = applicable.stream().filter(it -> !it.isExtractable()).collect(Collectors.toList());
        if (CollectionUtils.isNotEmpty(ready) || CollectionUtils.isNotEmpty(notExtractable)) {
            lines.add(detectorEvaluationTree.getDirectory().toString());
            if (CollectionUtils.isNotEmpty(ready)) {
                lines.add("\t    READY: " + ready.stream().map(it -> it.getDetectorRule().getDescriptiveName()).sorted().collect(Collectors.joining(", ")));
            }
        }
    }
    if (CollectionUtils.isNotEmpty(lines)) {
        ReporterUtils.printHeader(writer, "Preparation for extraction");
        lines.forEach(writer::writeLine);
        ReporterUtils.printFooter(writer);
    }
}
Also used : DetectorEvaluationTree(com.synopsys.integration.detector.base.DetectorEvaluationTree) DetectorEvaluation(com.synopsys.integration.detector.base.DetectorEvaluation) ReportWriter(com.synopsys.integration.detect.workflow.report.writer.ReportWriter) List(java.util.List) DetectorEvaluationUtils(com.synopsys.integration.detect.workflow.report.util.DetectorEvaluationUtils) ReporterUtils(com.synopsys.integration.detect.workflow.report.util.ReporterUtils) DetectorEvaluationTree(com.synopsys.integration.detector.base.DetectorEvaluationTree) Collectors(java.util.stream.Collectors) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) DetectorEvaluation(com.synopsys.integration.detector.base.DetectorEvaluation)

Example 5 with ReportWriter

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

the class DiagnosticReportHandler method configurationsReport.

public void configurationsReport(DetectInfo detectInfo, PropertyConfiguration propertyConfiguration, SortedMap<String, String> maskedRawPropertyValues, Set<String> propertyKeys) {
    try {
        ReportWriter profileWriter = getReportWriter(ReportTypes.CONFIGURATION);
        ConfigurationReporter reporter = new ConfigurationReporter();
        reporter.writeReport(profileWriter, detectInfo, propertyConfiguration, maskedRawPropertyValues, propertyKeys);
    } catch (Exception e) {
        logger.error("Failed to write profiling report.", e);
    }
}
Also used : ReportWriter(com.synopsys.integration.detect.workflow.report.writer.ReportWriter) FileReportWriter(com.synopsys.integration.detect.workflow.report.writer.FileReportWriter) InfoLogReportWriter(com.synopsys.integration.detect.workflow.report.writer.InfoLogReportWriter) ConfigurationReporter(com.synopsys.integration.detect.workflow.report.ConfigurationReporter)

Aggregations

ReportWriter (com.synopsys.integration.detect.workflow.report.writer.ReportWriter)5 FileReportWriter (com.synopsys.integration.detect.workflow.report.writer.FileReportWriter)4 InfoLogReportWriter (com.synopsys.integration.detect.workflow.report.writer.InfoLogReportWriter)4 ConfigurationReporter (com.synopsys.integration.detect.workflow.report.ConfigurationReporter)2 CodeLocationReporter (com.synopsys.integration.detect.workflow.report.CodeLocationReporter)1 ProfilingReporter (com.synopsys.integration.detect.workflow.report.ProfilingReporter)1 DetectorEvaluationUtils (com.synopsys.integration.detect.workflow.report.util.DetectorEvaluationUtils)1 ReporterUtils (com.synopsys.integration.detect.workflow.report.util.ReporterUtils)1 DetectorEvaluation (com.synopsys.integration.detector.base.DetectorEvaluation)1 DetectorEvaluationTree (com.synopsys.integration.detector.base.DetectorEvaluationTree)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 CollectionUtils (org.apache.commons.collections4.CollectionUtils)1