Skip to content
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

Merged
merged 30 commits into from
Jul 23, 2020
Merged

Pr orly ast support #356

merged 30 commits into from
Jul 23, 2020

Conversation

olgakil
Copy link
Contributor

@olgakil olgakil commented Jul 23, 2020

Refactoring to allow AST support

Existing tests on SCA should cover all the changes

@cxflowtestuser
Copy link
Collaborator

Scan submitted to Checkmarx

@cxflowtestuser
Copy link
Collaborator

Checkmarx scan completed

Full Scan Details

Checkmarx Scan Summary

Severity Count
High 0
Medium 112
Low 1407
Informational 38

Violation Summary

Severity Count

Details

Lines Severity Category File Link

@olgakil olgakil requested a review from AvivCx July 23, 2020 06:58
@olgakil olgakil merged commit c669f2c into develop Jul 23, 2020
ScanResults scaScanResults = null;
ScanResults astScanResults = null;

if(isSastEnabled()) {
Copy link
Contributor

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 {
Copy link
Contributor

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);
Copy link
Contributor

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.";
Copy link
Contributor

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.

Comment on lines +56 to +60
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);
Copy link
Contributor

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.

@olgakil olgakil deleted the pr-orly-ast-support branch July 30, 2020 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants