Skip to content

Commit

Permalink
Fix logic for gathering fixed findings
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed Dec 4, 2024
1 parent 78424fd commit fd8da5a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/codemodder/file_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,22 @@ def add_unfixed_findings(
]
)

def get_findings_for_location(self, line_number: int):
def get_findings_for_location(self, line_number: int) -> list[Finding]:
return [
result.finding
for result in (self.results or [])
if any(
location.start.line <= line_number <= location.end.line
for location in result.locations
)
or any(
location.start.line <= line_number <= location.end.line
for codeflow in result.codeflows
for location in codeflow
if result.finding is not None
and (
any(
location.start.line <= line_number <= location.end.line
for location in result.locations
)
or any(
location.start.line <= line_number <= location.end.line
for codeflow in result.codeflows
for location in codeflow
)
)
and result.finding is not None
]

def match_findings(self, line_numbers):
Expand Down

0 comments on commit fd8da5a

Please sign in to comment.