Skip to content

Commit e5f5371

Browse files
lint: Improving comprehension of the script
1 parent 37aca12 commit e5f5371

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ def main():
5757

5858
sarif_tool_name, sarif_data = sarifObj.load_sarif_data(sarif_file_path=sarif_file_path)
5959

60-
logger.info("[" + sarif_tool_name + "]: Total no. of issues found in SARIF report - " + str(sarif_data.get_result_count()))
60+
sarif_result_count = sarif_data.get_result_count()
6161

62-
if sarif_data.get_result_count() > 0:
62+
logger.info("[" + sarif_tool_name + "]: Total no. of issues found in SARIF report - " + str(sarif_result_count))
6363

64+
if sarif_result_count == 0:
65+
logger.error("[" + sarif_tool_name + "]: No results found.")
66+
67+
else:
6468
sarif_findings = sarifObj.build_sarif_findings_dict(
6569
sarif_tool_name=sarif_tool_name,
6670
sarif_data=sarif_data
@@ -121,8 +125,6 @@ def main():
121125
issue_desc = issue_desc,
122126
issue_type = "Task"
123127
)
124-
else:
125-
logger.error("[" + sarif_tool_name + "]: No results found.")
126128

127129
logger.info("Success.")
128130

0 commit comments

Comments
 (0)