Search in sources :

Example 1 with CxScanSummary

use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.

the class GetResultsAnalyticsTestSteps method createFakeSASTScanResults.

private static ScanResults createFakeSASTScanResults() {
    ScanResults result = new ScanResults();
    CxScanSummary summary = new CxScanSummary();
    result.setScanSummary(summary);
    Map<String, Object> details = new HashMap<>();
    details.put(Constants.SUMMARY_KEY, new HashMap<>());
    result.setAdditionalDetails(details);
    result.setXIssues(new ArrayList<>());
    return result;
}
Also used : ScanResults(com.checkmarx.sdk.dto.ScanResults) CxScanSummary(com.checkmarx.sdk.dto.cx.CxScanSummary)

Example 2 with CxScanSummary

use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.

the class AnalyticsSteps method createFakeSASTScanResults.

private static ScanResults createFakeSASTScanResults(Map<FindingSeverity, Integer> findingsPerSeverity) {
    CxScanSummary summary = new CxScanSummary();
    summary.setHighSeverity(findingsPerSeverity.get(FindingSeverity.HIGH));
    summary.setMediumSeverity(findingsPerSeverity.get(FindingSeverity.MEDIUM));
    summary.setLowSeverity(findingsPerSeverity.get(FindingSeverity.LOW));
    summary.setInfoSeverity(0);
    HashMap<String, Object> flowSummary = new HashMap<>();
    findingsPerSeverity.forEach((severity, count) -> flowSummary.put(severity.toString(), count));
    Map<String, Object> details = new HashMap<>();
    details.put(Constants.SUMMARY_KEY, flowSummary);
    return ScanResults.builder().scanSummary(summary).additionalDetails(details).xIssues(new ArrayList<>()).build();
}
Also used : CxScanSummary(com.checkmarx.sdk.dto.cx.CxScanSummary)

Example 3 with CxScanSummary

use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.

the class Github2AdoSteps method createAstFindings.

private void createAstFindings(ScanResults result) {
    result.setAstResults(new ASTResults());
    result.getAstResults().setScanId("111");
    result.getAstResults().setWebReportLink(WEB_REPORT_LINK);
    LinkedList<Finding> findings = new LinkedList();
    findings.add(createAstFinding(1));
    findings.add(createAstFinding(2));
    result.getAstResults().setFindings(findings);
    result.setScanSummary(new CxScanSummary());
    result.getAstResults().setSummary(new AstSummaryResults());
}
Also used : AstSummaryResults(com.checkmarx.sdk.dto.ast.report.AstSummaryResults) Finding(com.checkmarx.sdk.dto.ast.report.Finding) ASTResults(com.checkmarx.sdk.dto.ast.ASTResults) CxScanSummary(com.checkmarx.sdk.dto.cx.CxScanSummary)

Example 4 with CxScanSummary

use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.

the class ScanFixture method getScanResults.

public static ScanResults getScanResults() {
    CxScanSummary scanSummary = new CxScanSummary();
    scanSummary.setHighSeverity(1);
    scanSummary.setMediumSeverity(1);
    scanSummary.setLowSeverity(1);
    scanSummary.setInfoSeverity(1);
    scanSummary.setStatisticsCalculationDate("");
    return ScanResults.builder().projectId(String.valueOf(PROJECT_ID)).team(TEAM_PATH).project(PROJECT_NAME).link(SCAN_LINK).files(FILES_SCANNED).loc(LOC_SCANNED).scanType(SCAN_TYPE).additionalDetails(null).scanSummary(scanSummary).xIssues(Lists.emptyList()).build();
}
Also used : CxScanSummary(com.checkmarx.sdk.dto.cx.CxScanSummary)

Example 5 with CxScanSummary

use of com.checkmarx.sdk.dto.cx.CxScanSummary in project cx-flow by checkmarx-ltd.

the class ThresholdsSteps 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;
}
Also used : HashMap(java.util.HashMap) ScanResults(com.checkmarx.sdk.dto.ScanResults) CxScanSummary(com.checkmarx.sdk.dto.cx.CxScanSummary)

Aggregations

CxScanSummary (com.checkmarx.sdk.dto.cx.CxScanSummary)15 ScanResults (com.checkmarx.sdk.dto.ScanResults)6 JSONObject (org.json.JSONObject)2 ASTResults (com.checkmarx.sdk.dto.ast.ASTResults)1 AstSummaryResults (com.checkmarx.sdk.dto.ast.report.AstSummaryResults)1 Finding (com.checkmarx.sdk.dto.ast.report.Finding)1 SCAResults (com.checkmarx.sdk.dto.sca.SCAResults)1 Summary (com.checkmarx.sdk.dto.sca.Summary)1 Finding (com.checkmarx.sdk.dto.sca.report.Finding)1 Package (com.checkmarx.sdk.dto.sca.report.Package)1 CheckmarxException (com.checkmarx.sdk.exception.CheckmarxException)1 CxClient (com.checkmarx.sdk.service.scanner.CxClient)1 HashMap (java.util.HashMap)1 Test (org.junit.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1 LinkedMultiValueMap (org.springframework.util.LinkedMultiValueMap)1 MultiValueMap (org.springframework.util.MultiValueMap)1