use of com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerReport in project synopsys-detect by blackducksoftware.
the class PublishSignatureScanReports method publishReports.
public void publishReports(List<SignatureScannerReport> signatureScannerReports) {
signatureScannerReports.forEach(this::publishReport);
signatureScannerReports.stream().filter(SignatureScannerReport::isFailure).findAny().ifPresent(report -> {
logger.error(String.format("The Signature Scanner reported an error%s. The Signature Scanner log may contain relevant information.", report.getExitCode().map(code -> " (" + code + ")").orElse(".")));
exitCodePublisher.publishExitCode(new ExitCodeRequest(ExitCodeType.FAILURE_SCAN));
});
if (!treatSkippedScanAsSuccess) {
signatureScannerReports.stream().filter(SignatureScannerReport::isSkipped).findAny().ifPresent(report -> {
logger.error("The Signature Scanner skipped a scan because the minimum scan interval was not met.");
exitCodePublisher.publishExitCode(new ExitCodeRequest(ExitCodeType.FAILURE_MINIMUM_INTERVAL_NOT_MET));
});
}
}
use of com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerReport in project synopsys-detect by blackducksoftware.
the class CreateSignatureScanReports method reportResults.
public List<SignatureScannerReport> reportResults(List<SignatureScanPath> signatureScanPaths, List<ScanCommandOutput> scanCommandOutputList) {
List<SignatureScannerReport> signatureScannerReports = new ArrayList<>();
for (SignatureScanPath signatureScanPath : signatureScanPaths) {
Optional<ScanCommandOutput> scanCommandOutput = scanCommandOutputList.stream().filter(output -> output.getScanTarget().equals(signatureScanPath.getTargetCanonicalPath())).findFirst();
SignatureScannerReport signatureScannerReport = SignatureScannerReport.create(signatureScanPath, scanCommandOutput.orElse(null));
signatureScannerReports.add(signatureScannerReport);
}
return signatureScannerReports;
}
Aggregations