Skip to content

Commit

Permalink
Merge pull request #407 from DataDog/s.obregoso/fix_remove_repeated_f…
Browse files Browse the repository at this point in the history
…indings

Remove duplicated sourcode findings
  • Loading branch information
sobregosodd authored Jul 15, 2024
2 parents c0d6ec0 + 5be1bd1 commit d3211d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions guarddog/analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,16 @@ def _format_semgrep_response(self, response, rule=None, targetpath=None):
location = file_path + ":" + str(line)
code = self.trim_code_snippet(code_snippet)

results[rule_name].append({
finding = {
'location': location,
'code': code,
'message': result["extra"]["message"]
})
}

rule_results = results[rule_name]
if finding in rule_results:
continue
results[rule_name].append(finding)

return results

Expand Down

0 comments on commit d3211d8

Please sign in to comment.