use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.
the class HTMLHelper method addScanSummarySection.
private static void addScanSummarySection(ScanRequest request, ScanResults results, RepoProperties properties, StringBuilder body) {
setScannerLogoHeader(request, results, body);
setScannerSummaryHeader(results, body);
CxScanSummary summary = results.getScanSummary();
setScannerTotalVulnerabilities(body, summary, request);
if (properties.isCxSummary() && !request.getProduct().equals(ScanRequest.Product.CXOSA)) {
if (!ScanUtils.empty(properties.getCxSummaryHeader())) {
appendAll(body, MarkDownHelper.getMdHeaderType(4, properties.getCxSummaryHeader()), CRLF);
}
MarkDownHelper.appendMDtableHeaders(body, SEVERITY, "Count");
MarkDownHelper.appendMDtableRow(body, "High", summary.getHighSeverity().toString());
MarkDownHelper.appendMDtableRow(body, "Medium", summary.getMediumSeverity().toString());
MarkDownHelper.appendMDtableRow(body, "Low", summary.getLowSeverity().toString());
MarkDownHelper.appendMDtableRow(body, "Informational", summary.getInfoSeverity().toString());
body.append(CRLF);
}
}
use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.
the class ScanUtils method setAstScanSummary.
private static void setAstScanSummary(ScanResults results) {
CxScanSummary scanSummary = new CxScanSummary();
scanSummary.setHighSeverity(results.getAstResults().getSummary().getHighVulnerabilityCount());
scanSummary.setMediumSeverity(results.getAstResults().getSummary().getMediumVulnerabilityCount());
scanSummary.setLowSeverity(results.getAstResults().getSummary().getLowVulnerabilityCount());
scanSummary.setInfoSeverity(0);
results.setLink(results.getAstResults().getWebReportLink());
results.setScanSummary(scanSummary);
}
use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.
the class FilterScriptSteps method getCxClientSpy.
private CxClient getCxClientSpy(RestTemplate restTemplateMock, CxAuthService authClientMock) throws CheckmarxException {
CxClient cxClient = new CxService(authClientMock, cxProperties, cxLegacyService, restTemplateMock, null, filterInputFactory, filterValidator);
CxClient cxClientSpy = spy(cxClient);
doReturn(new CxScanSummary()).when(cxClientSpy).getScanSummaryByScanId(any());
return cxClientSpy;
}
use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.
the class Github2AdoSteps method createFakeResults.
private ScanResults createFakeResults() {
ScanResults result = new ScanResults();
result.setScanSummary(new CxScanSummary());
Map<String, Object> details = new HashMap<>();
details.put(Constants.SUMMARY_KEY, new HashMap<>());
if (scannerType.equals(AST)) {
createAstFindings(result);
}
result.setAdditionalDetails(details);
result.setXIssues(ScanResultsBuilder.get2XIssues());
return result;
}
use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.
the class CxConfigSteps method createFakeScanResults.
private static ScanResults createFakeScanResults() {
ScanResults result = new ScanResults();
result.setScanSummary(new CxScanSummary());
Map<String, Object> details = new HashMap<>();
details.put(Constants.SUMMARY_KEY, new HashMap<>());
result.setAdditionalDetails(details);
result.setXIssues(new ArrayList<>());
return result;
}
Aggregations