Search in sources :

Example 1 with ScaClientHelper

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);
    }
}
Also used : ScaClientHelper(com.checkmarx.sdk.utils.scanner.client.ScaClientHelper) ScanParams(com.checkmarx.sdk.dto.ast.ScanParams) ScanResults(com.checkmarx.sdk.dto.ScanResults) MachinaException(com.checkmarx.flow.exception.MachinaException) CheckmarxException(com.checkmarx.sdk.exception.CheckmarxException) IScanClientHelper(com.checkmarx.sdk.utils.scanner.client.IScanClientHelper) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig)

Aggregations

MachinaException (com.checkmarx.flow.exception.MachinaException)1 RestClientConfig (com.checkmarx.sdk.config.RestClientConfig)1 ScanResults (com.checkmarx.sdk.dto.ScanResults)1 ScanParams (com.checkmarx.sdk.dto.ast.ScanParams)1 CheckmarxException (com.checkmarx.sdk.exception.CheckmarxException)1 IScanClientHelper (com.checkmarx.sdk.utils.scanner.client.IScanClientHelper)1 ScaClientHelper (com.checkmarx.sdk.utils.scanner.client.ScaClientHelper)1