Skip to content

Commit 0010040

Browse files
authored
Do not filter Sonar results by status (#1072)
1 parent 6c101d3 commit 0010040

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

src/core_codemods/sonar/results.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ def from_json(cls, json_file: str | Path) -> Self:
120120

121121
result_set = cls()
122122
for result in data.get("issues", []) + data.get("hotspots", []):
123-
if result["status"].lower() in ("open", "to_review"):
124-
result_set.add_result(SonarResult.from_result(result))
123+
result_set.add_result(SonarResult.from_result(result))
125124

126125
return result_set
127126
except Exception:

tests/test_results.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -216,39 +216,6 @@ def test_or(self, tmpdir):
216216
result2["python:S5659"][Path("code.py")][0],
217217
]
218218

219-
def test_sonar_only_open_issues(self, tmpdir):
220-
issues = {
221-
"issues": [
222-
{
223-
"rule": "python:S5659",
224-
"status": "OPEN",
225-
"component": "code.py",
226-
"textRange": {
227-
"startLine": 1,
228-
"endLine": 1,
229-
"startOffset": 1,
230-
"endOffset": 1,
231-
},
232-
},
233-
{
234-
"rule": "python:S5659",
235-
"status": "RESOLVED",
236-
"component": "code.py",
237-
"textRange": {
238-
"startLine": 1,
239-
"endLine": 1,
240-
"startOffset": 1,
241-
"endOffset": 1,
242-
},
243-
},
244-
]
245-
}
246-
sonar_json1 = Path(tmpdir) / "sonar1.json"
247-
sonar_json1.write_text(json.dumps(issues))
248-
249-
result = SonarResultSet.from_json(sonar_json1)
250-
assert len(result["python:S5659"][Path("code.py")]) == 1
251-
252219
def test_sonar_flows(self, tmpdir):
253220
issues = {
254221
"issues": [

0 commit comments

Comments
 (0)