use of com.checkmarx.sdk.utils.scanner.client.IScanClientHelper 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);
}
}
use of com.checkmarx.sdk.utils.scanner.client.IScanClientHelper in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ScaScanner method getLatestScanResults.
public AstScaResults getLatestScanResults(ScanParams scanParams) {
RestClientConfig config = getScanConfig(scanParams);
try {
IScanClientHelper client = allocateClient(config);
client.init();
ResultsBase results = client.getLatestScanResults();
AstScaResults result;
if (results != null) {
result = toResults(results);
applyFilterToResults(result, scanParams);
} else {
result = new AstScaResults();
}
return result;
} catch (Exception e) {
throw new ScannerRuntimeException("Error getting latest scan results.", e);
}
}
Aggregations