use of com.synopsys.integration.detector.base.DetectorEvaluationTree in project synopsys-detect by blackducksoftware.
the class DiagnosticReportHandler method completedBomToolEvaluations.
public void completedBomToolEvaluations(DetectorToolResult detectorToolResult) {
this.detectorToolResult = detectorToolResult;
DetectorEvaluationTree rootEvaluation;
if (detectorToolResult.getRootDetectorEvaluationTree().isPresent()) {
rootEvaluation = detectorToolResult.getRootDetectorEvaluationTree().get();
} else {
logger.warn("Detectors completed, but no evaluation was found, unable to write detector reports.");
return;
}
try {
SearchSummaryReporter searchReporter = new SearchSummaryReporter();
searchReporter.print(getReportWriter(ReportTypes.SEARCH), rootEvaluation);
} catch (Exception e) {
logger.error("Failed to write search report.", e);
}
try {
DetailedSearchSummaryReporter searchReporter = new DetailedSearchSummaryReporter();
searchReporter.print(getReportWriter(ReportTypes.SEARCH_DETAILED), rootEvaluation);
} catch (Exception e) {
logger.error("Failed to write detailed search report.", e);
}
try {
OverviewSummaryReporter overviewSummaryReporter = new OverviewSummaryReporter();
overviewSummaryReporter.writeReport(getReportWriter(ReportTypes.DETECTOR), rootEvaluation);
} catch (Exception e) {
logger.error("Failed to write detector report.", e);
}
}
use of com.synopsys.integration.detector.base.DetectorEvaluationTree 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);
}
}
Aggregations