@ SuppressWarnings ( "PMD" ) public static Map < AuditType , Audit > getAudit ( Dashboard dashboard , AuditSettings settings , long begin , long end ) { Map < AuditType , Audit > audits = new HashMap <> ( ) ; String url = getAuditAPIUrl ( dashboard , settings , begin , end ) ; JSONObject auditResponseObj = parseObject ( url , settings ) ; if ( auditResponseObj == null ) { return audits ; } JSONArray globalStatus = ( JSONArray ) auditResponseObj . get ( STR_AUDITSTATUSES ) ; JSONObject review = ( JSONObject ) auditResponseObj . get ( STR_REVIEW ) ; JSONArray codeReviewJO = review . get ( AuditType . CODE_REVIEW . name ( ) ) == null ? null : ( JSONArray ) review . get ( AuditType . CODE_REVIEW . name ( ) ) ; Audit audit = getCodeReviewAudit ( codeReviewJO , globalStatus ) ; audits . put ( audit . getType ( ) , audit ) ; JSONArray scaJO = review . get ( AuditType . CODE_QUALITY . name ( ) ) == null ? null : ( JSONArray ) review . get ( AuditType . CODE_QUALITY . name ( ) ) ; audit = getCodeQualityAudit ( scaJO , globalStatus ) ; audits . put ( audit . getType ( ) , audit ) ; JSONArray perfJO = review . get ( AuditType . PERF_TEST . name ( ) ) == null ? null : ( JSONArray ) review . get ( AuditType . PERF_TEST . name ( ) ) ; audit = getPerfAudit ( perfJO , globalStatus ) ; audits . put ( audit . getType ( ) , audit ) ; JSONArray ossJO = review . get ( AuditType . LIBRARY_POLICY . name ( ) ) == null ? null : ( JSONArray ) review . get ( AuditType . LIBRARY_POLICY . name ( ) ) ; audit = getOSSAudit ( ossJO , globalStatus ) ; audits . put ( audit . getType ( ) , audit ) ; JSONArray testJO = review . get ( AuditType . TEST_RESULT . name ( ) ) == null ? null : ( JSONArray ) review . get ( AuditType . TEST_RESULT . name ( ) ) ; audit = getTestAudit ( testJO , globalStatus ) ; audits . put ( audit . getType ( ) , audit ) ; JSONArray sscaJO = review . get ( AuditType . STATIC_SECURITY_ANALYSIS . name ( ) ) == null ? null : ( JSONArray ) review . get ( AuditType . STATIC_SECURITY_ANALYSIS . name ( ) ) ; audit = getSecurityAudit ( sscaJO , globalStatus ) ; audits . put ( audit . getType ( ) , audit ) ; return audits ; }
Get all audit results