File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
plugin/src/main/java/org/owasp/benchmarkutils/score/parsers Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 19
19
20
20
import org .json .JSONArray ;
21
21
import org .json .JSONObject ;
22
- import org .owasp .benchmarkutils .score .*;
22
+ import org .owasp .benchmarkutils .score .CweNumber ;
23
+ import org .owasp .benchmarkutils .score .ResultFile ;
24
+ import org .owasp .benchmarkutils .score .TestCaseResult ;
25
+ import org .owasp .benchmarkutils .score .TestSuiteResults ;
23
26
24
27
public class GitLabSastReader extends Reader {
25
28
@ Override
@@ -53,10 +56,9 @@ public TestSuiteResults parse(ResultFile resultFile) throws Exception {
53
56
private TestCaseResult parseGitLabSastFindings (JSONObject vulnerability ) {
54
57
55
58
try {
56
- String className = vulnerability .getJSONObject ("location" ).getString ("file" );
57
- className = (className .substring (className .lastIndexOf ('/' ) + 1 )).split ("\\ ." )[0 ];
59
+ int testNumber = testNumber (vulnerability .getJSONObject ("location" ).getString ("file" ));
58
60
59
- if (className . startsWith ( BenchmarkScore . TESTCASENAME ) ) {
61
+ if (testNumber > - 1 ) {
60
62
TestCaseResult tcr = new TestCaseResult ();
61
63
62
64
JSONArray identifiers = vulnerability .getJSONArray ("identifiers" );
@@ -73,7 +75,7 @@ private TestCaseResult parseGitLabSastFindings(JSONObject vulnerability) {
73
75
tcr .setCategory (category );
74
76
tcr .setEvidence (evidence );
75
77
tcr .setConfidence (0 );
76
- tcr .setNumber (testNumber ( className ) );
78
+ tcr .setNumber (testNumber );
77
79
78
80
return tcr ;
79
81
}
You can’t perform that action at this time.
0 commit comments