Skip to content

Commit f5c872e

Browse files
committed
htmlreport: stats: display total number of warnings/errors.
1 parent 62cde67 commit f5c872e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

htmlreport/cppcheck-htmlreport

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,12 @@ if __name__ == '__main__':
412412
with io.open(os.path.join(options.report_dir, 'index.html'),
413413
'w') as output_file:
414414

415+
stats_count = 0
415416
stats = []
416417
for filename, data in sorted(files.items()):
417418
for error in data['errors']:
418419
stats.append(error['id']) # get the stats
420+
stats_count += 1
419421

420422
stat_html = []
421423
# the following lines sort the stat primary by value (occurrences),
@@ -435,7 +437,7 @@ if __name__ == '__main__':
435437
stat_html.append(" " + str(dict(Counter(stats).most_common())[_id]) + " " + str(_id) + "<br/>\n")
436438

437439
output_file.write(HTML_HEAD.replace('id="menu" dir="rtl"', 'id="menu_index"', 1).replace("Defect list", "Defect summary", 1) % (options.title, '', options.title, ''))
438-
output_file.write(' <p>\n' + ''.join(stat_html) + ' </p>')
440+
output_file.write(' <p>\n' + ' ' + str(stats_count) + ' total<br/><br/>\n' + ''.join(stat_html) + ' </p>')
439441
output_file.write(HTML_HEAD_END.replace("content", "content_index", 1))
440442
output_file.write(' <table>\n')
441443
output_file.write(

0 commit comments

Comments
 (0)