-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pr orly ast support #356
Pr orly ast support #356
Conversation
Scan submitted to Checkmarx |
Checkmarx scan completedCheckmarx Scan Summary
Violation Summary
Details
|
ScanResults scaScanResults = null; | ||
ScanResults astScanResults = null; | ||
|
||
if(isSastEnabled()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a 'for' loop here or reuse the existing one?
@@ -451,8 +453,7 @@ private String getOptionValues(ApplicationArguments arg, String option){ | |||
} | |||
|
|||
private void cxScan(ScanRequest request, String gitUrl, String gitAuthUrl, String branch, ScanRequest.Repository repoType) throws ExitThrowable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a more meaningful name instead of cxScan()? It's not clear by looking at the code what is the difference between cxScan() and scan().
} | ||
|
||
private boolean isAstEnabled() { | ||
return flowProperties.getEnabledVulnerabilityScanners().contains(AST_SCANNER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there cases when getEnabledVulnerabilityScanners() returns null?
Files.deleteIfExists(Paths.get(cxZipFile)); | ||
|
||
} catch (Exception e) { | ||
final String message = "SCA scan failed."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like 'scanType' should be used here instead of SCA.
final String message = "SCA scan failed."; | ||
log.error(message, e); | ||
OperationResult scanCreationFailure = new OperationResult(OperationStatus.FAILURE, e.getMessage()); | ||
logRequest(scanRequest, getScanId(internalResults), scanCreationFailure); | ||
throw new MachinaRuntimeException(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve this code duplication.
Refactoring to allow AST support
Existing tests on SCA should cover all the changes