Skip to content

Commit c7e745f

Browse files
author
Jino Tesauro
committed
Added protection for type mismatch
1 parent 79a9ea6 commit c7e745f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

dojo/tools/sonarqube/sonarqube_restapi_json.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_json_items(self, json_content, test, mode):
1313
rule = issue.get("rule")
1414
component = issue.get("component")
1515
project = issue.get("project")
16-
line = str(issue.get("line"))
16+
line = issue.get("line")
1717
textRange = issue.get("textRange", {})
1818
flows = issue.get("flows", [])
1919
status = issue.get("status")
@@ -28,7 +28,7 @@ def get_json_items(self, json_content, test, mode):
2828
description += "**rule:** " + rule + "\n"
2929
description += "**component:** " + component + "\n"
3030
description += "**project:** " + project + "\n"
31-
description += "**line:** " + line + "\n"
31+
description += "**line:** " + str(line) + "\n"
3232
if bool(textRange):
3333
res = [item + ": " + str(textRange[item]) for item in textRange]
3434
description += "**textRange:** " + ", ".join(res) + "\n"
@@ -59,7 +59,7 @@ def get_json_items(self, json_content, test, mode):
5959
flows = issue.get("flows", [])
6060
status = issue.get("status")
6161
message = issue.get("message")
62-
line = str(issue.get("line"))
62+
line = issue.get("line")
6363
cwe = None
6464
if "Category: CWE-" in message:
6565
cwe_pattern = r"Category: CWE-\d{1,5}"
@@ -93,7 +93,7 @@ def get_json_items(self, json_content, test, mode):
9393
description += "**rule:** " + rule + "\n"
9494
description += "**component:** " + component + "\n"
9595
description += "**project:** " + project + "\n"
96-
description += "**line:** " + line + "\n"
96+
description += "**line:** " + str(line) + "\n"
9797
if flows != []:
9898
description += "**flows:** " + str(flows) + "\n"
9999
description += "**status:** " + status + "\n"
@@ -145,7 +145,7 @@ def get_json_items(self, json_content, test, mode):
145145
rule = issue.get("rule")
146146
component = issue.get("component")
147147
project = issue.get("project")
148-
line = str(issue.get("line"))
148+
line = issue.get("line")
149149
textRange = issue.get("textRange", {})
150150
flows = issue.get("flows", [])
151151
status = issue.get("status")
@@ -158,7 +158,7 @@ def get_json_items(self, json_content, test, mode):
158158
description += "**rule:** " + rule + "\n"
159159
description += "**component:** " + component + "\n"
160160
description += "**project:** " + project + "\n"
161-
description += "**line:** " + line + "\n"
161+
description += "**line:** " + str(line) + "\n"
162162
if bool(textRange):
163163
res = []
164164
for item in textRange:
@@ -194,7 +194,7 @@ def get_json_items(self, json_content, test, mode):
194194
project = hotspot.get("project")
195195
securityCategory = hotspot.get("securityCategory")
196196
status = hotspot.get("status")
197-
line = str(hotspot.get("line"))
197+
line = hotspot.get("line")
198198
message = hotspot.get("message")
199199
textRange = hotspot.get("textRange", {})
200200
flows = hotspot.get("flows", [])
@@ -206,7 +206,7 @@ def get_json_items(self, json_content, test, mode):
206206
description += "**project:** " + project + "\n"
207207
description += "**securityCategory:** " + securityCategory + "\n"
208208
description += "**status:** " + status + "\n"
209-
description += "**line:** " + line + "\n"
209+
description += "**line:** " + str(line) + "\n"
210210
description += "**message:** " + message + "\n"
211211
if bool(textRange):
212212
res = []

0 commit comments

Comments
 (0)