Skip to content

Commit 404e40a

Browse files
committed
test with real report from Syn project
1 parent 0c43a88 commit 404e40a

File tree

8 files changed

+4096
-2
lines changed

8 files changed

+4096
-2
lines changed

src/main/java/org/elegoff/plugins/rust/externalreport/clippy/ClippyJsonReportReader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@ private void onResult(JSONObject result) {
5454
Issue issue = new Issue();
5555

5656
JSONObject message = (JSONObject) result.get("message");
57+
if (message == null) return;
5758
JSONObject code = (JSONObject) message.get("code");
5859
if (code == null) return;
5960
issue.ruleKey = (String) code.get("code");
6061

62+
System.out.println("[ELG] rule found : " + issue.ruleKey);
63+
64+
6165
JSONArray spans = (JSONArray) message.get("spans");
6266
if ((spans == null)||spans.size()==0) return;
63-
JSONObject span = (JSONObject) spans.get(0); //TODO what if > 1 span ?
67+
JSONObject span = (JSONObject) spans.get(0);
6468
issue.filePath = (String) span.get("file_name");
6569

6670

0 commit comments

Comments
 (0)