Skip to content

Commit c1150c3

Browse files
committed
feat(report): add defect count on home page
1 parent 3861f36 commit c1150c3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

codesectools/sasts/all/cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,11 @@ def report(
300300
home_page = Console(record=True, file=io.StringIO())
301301

302302
main_table = Table(title="")
303-
main_table.add_column("Files (sorted by defect number)")
303+
main_table.add_column("Files")
304+
for key in list(report_data["defects"].values())[0]["score"].keys():
305+
main_table.add_column(
306+
key.replace("_", " ").title(), justify="center", no_wrap=True
307+
)
304308

305309
for defect_data in track(
306310
report_data["defects"].values(),
@@ -332,7 +336,8 @@ def report(
332336
shorten_path(defect_data["source_path"], 60),
333337
style=Style(link=defect_report_name),
334338
)
335-
main_table.add_row(defect_report_redirect)
339+
340+
main_table.add_row(defect_report_redirect, *rendered_scores)
336341

337342
# Defect table
338343
defect_table = Table(title="", show_lines=True)

0 commit comments

Comments
 (0)