refactor(sonar): Moved event publishing.
@@ -116,15 +116,6 @@ public class BlackDuckSignatureScanner {
signatureScannerReports.forEach(this::reportErrors);
- signatureScannerReports.stream()
- .filter(SignatureScannerReport::isFailure)
- .forEach(signatureScannerReport -> eventSystem.publishEvent(Event.StatusSummary,
- new SignatureScanStatus(
- signatureScannerReport.getSignatureScanPath().getTargetCanonicalPath(),
- signatureScannerReport.getStatusType()
- ))
- );
-
signatureScannerReports.stream()
.map(SignatureScannerReport::getExitCode)
.filter(Optional::isPresent)
@@ -157,6 +148,10 @@ public class BlackDuckSignatureScanner {
eventSystem.publishEvent(Event.Issue, new DetectIssue(DetectIssueType.SIGNATURE_SCANNER, Collections.singletonList(errorMessage)));
}
+
+ if (signatureScannerReport.isFailure()) {
+ eventSystem.publishEvent(Event.StatusSummary, new SignatureScanStatus(signatureScannerReport.getSignatureScanPath().getTargetCanonicalPath(), signatureScannerReport.getStatusType()));
+ }
}
private List<SignatureScanPath> determinePathsAndExclusions(NameVersion projectNameVersion, Integer maxDepth, File dockerTarFile) throws IOException {
