diff --git a/src/core_codemods/sonar/results.py b/src/core_codemods/sonar/results.py index 2c6025ae..26ac9de4 100644 --- a/src/core_codemods/sonar/results.py +++ b/src/core_codemods/sonar/results.py @@ -120,8 +120,7 @@ def from_json(cls, json_file: str | Path) -> Self: result_set = cls() for result in data.get("issues", []) + data.get("hotspots", []): - if result["status"].lower() in ("open", "to_review"): - result_set.add_result(SonarResult.from_result(result)) + result_set.add_result(SonarResult.from_result(result)) return result_set except Exception: diff --git a/tests/test_results.py b/tests/test_results.py index 97990596..34ef8592 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -216,39 +216,6 @@ def test_or(self, tmpdir): result2["python:S5659"][Path("code.py")][0], ] - def test_sonar_only_open_issues(self, tmpdir): - issues = { - "issues": [ - { - "rule": "python:S5659", - "status": "OPEN", - "component": "code.py", - "textRange": { - "startLine": 1, - "endLine": 1, - "startOffset": 1, - "endOffset": 1, - }, - }, - { - "rule": "python:S5659", - "status": "RESOLVED", - "component": "code.py", - "textRange": { - "startLine": 1, - "endLine": 1, - "startOffset": 1, - "endOffset": 1, - }, - }, - ] - } - sonar_json1 = Path(tmpdir) / "sonar1.json" - sonar_json1.write_text(json.dumps(issues)) - - result = SonarResultSet.from_json(sonar_json1) - assert len(result["python:S5659"][Path("code.py")]) == 1 - def test_sonar_flows(self, tmpdir): issues = { "issues": [