use of com.checkmarx.sdk.utils.scanner.client.ScaClientHelper in project cx-flow by checkmarx-ltd.
the class SCAScanner method cxParseResults.
@Override
protected void cxParseResults(ScanRequest scanRequest, File file) throws ExitThrowable {
RestClientConfig restClientConfig;
IScanClientHelper iScanClientHelper;
try {
ScanParams sdkScanParams = ScanParams.builder().projectName(scanRequest.getProject()).scaConfig(scanRequest.getScaConfig()).filterConfiguration(scanRequest.getFilter()).build();
restClientConfig = scaScannerClient.getScanConfig(sdkScanParams);
iScanClientHelper = new ScaClientHelper(restClientConfig, log, scaProperties);
ScanResults results = iScanClientHelper.getReportContent(file, scanRequest.getFilter());
resultsService.processResults(scanRequest, results, scanDetails);
if (flowProperties.isBreakBuild() && results != null && results.getXIssues() != null && !results.getXIssues().isEmpty()) {
log.error(ERROR_BREAK_MSG);
exit(ExitCode.BUILD_INTERRUPTED);
}
} catch (MachinaException | CheckmarxException e) {
log.error("Error occurred while processing results file", e);
exit(3);
}
}
Aggregations