use of com.checkmarx.sdk.dto.ast.ScanParams in project cx-flow by checkmarx-ltd.
the class AbstractASTScanner method scan.
@Override
public ScanResults scan(ScanRequest scanRequest) {
ScanResults result = null;
log.info("--------------------- Initiating new {} scan ---------------------", scanType);
ScanParams sdkScanParams = toSdkScanParams(scanRequest);
AstScaResults internalResults = new AstScaResults(new SCAResults(), new ASTResults());
try {
bugTrackerEventTrigger.triggerScanStartedEvent(scanRequest);
internalResults = client.scan(sdkScanParams);
logRequest(scanRequest, internalResults, OperationResult.successful());
result = toScanResults(internalResults);
} catch (Exception e) {
treatError(scanRequest, internalResults, e);
}
return result;
}
use of com.checkmarx.sdk.dto.ast.ScanParams in project cx-flow by checkmarx-ltd.
the class AbstractASTScanner method scan.
public ScanResults scan(ScanRequest scanRequest, String path) throws ExitThrowable {
BugTracker.Type bugTrackerType = bugTrackerEventTrigger.triggerScanStartedEvent(scanRequest);
ScanResults result = null;
if (bugTrackerType.equals(BugTracker.Type.NONE)) {
log.info("Not waiting for scan completion as Bug Tracker type is NONE");
ScanParams sdkScanParams = toSdkScanParams(scanRequest, path);
client.scanWithNoWaitingToResults(sdkScanParams);
} else {
result = actualScan(scanRequest, path);
}
return result;
}
use of com.checkmarx.sdk.dto.ast.ScanParams in project cx-flow by checkmarx-ltd.
the class AbstractASTScanner method getLatestScanResults.
@Override
public ScanResults getLatestScanResults(ScanRequest request) {
ScanParams sdkScanParams = ScanParams.builder().projectName(request.getProject()).scaConfig(request.getScaConfig()).filterConfiguration(request.getFilter()).build();
setScannerSpecificProperties(request, sdkScanParams);
AstScaResults internalResults = client.getLatestScanResults(sdkScanParams);
return toScanResults(internalResults);
}
use of com.checkmarx.sdk.dto.ast.ScanParams in project cx-flow by checkmarx-ltd.
the class AbstractASTScanner method actualScan.
private ScanResults actualScan(ScanRequest scanRequest, String path) {
ScanResults result = null;
log.info("--------------------- Initiating new {} scan ---------------------", scanType);
AstScaResults internalResults = new AstScaResults(new SCAResults(), new ASTResults());
try {
ScanParams sdkScanParams = toSdkScanParams(scanRequest, path);
internalResults = client.scan(sdkScanParams);
logRequest(scanRequest, internalResults, OperationResult.successful());
result = toScanResults(internalResults);
} catch (Exception e) {
treatError(scanRequest, internalResults, e);
}
return result;
}
use of com.checkmarx.sdk.dto.ast.ScanParams in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ScaScanner method extractFilterConfigFrom.
private static EngineFilterConfiguration extractFilterConfigFrom(ScanParams scanParams) {
EngineFilterConfiguration result = Optional.ofNullable(scanParams).map(ScanParams::getFilterConfiguration).map(FilterConfiguration::getScaFilters).orElse(null);
String message = (result == null ? "No SCA filter configuration was found in {}" : "Found SCA filter configuration in {}");
log.debug(message, ScanParams.class.getSimpleName());
return result;
}
Aggregations