Skip to content

Commit

Permalink
🐛 fix according to comment
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-sommer committed Jan 16, 2024
1 parent 74462af commit 0a81a65
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dojo/tools/chefinspect/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ def convert_score(self, raw_value):
val = float(raw_value)
if val == 0.0:
return "Info"
elif val == 1.0:
elif val < 4.0:
return "Low"
elif val < 7.0:
return "Medium"
elif val < 9.0:
return "High"
else:
return "Critical"

def get_findings(self, file, test):
lines = file.read()
Expand All @@ -40,7 +46,7 @@ def get_findings(self, file, test):
description += "platform: " + str(json_object.get('platform')) + "\n"
description += "profile: " + str(json_object.get('profile')) + "\n"
description += "group: " + str(json_object.get('group')) + "\n"
description += "result: " + str(json_object.get('office')) + "\n"
description += "results: " + str(json_object.get('results')) + "\n"
result.append(
Finding(
title=json_object.get("title"),
Expand Down

0 comments on commit 0a81a65

Please sign in to comment.