From f5c872ed52cd8a4da24cb5b037e38bab021221bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 30 Jul 2014 01:08:16 +0200 Subject: [PATCH] htmlreport: stats: display total number of warnings/errors. --- htmlreport/cppcheck-htmlreport | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport index 84b9ad5f3..f8b1a7e87 100755 --- a/htmlreport/cppcheck-htmlreport +++ b/htmlreport/cppcheck-htmlreport @@ -412,10 +412,12 @@ if __name__ == '__main__': with io.open(os.path.join(options.report_dir, 'index.html'), 'w') as output_file: + stats_count = 0 stats = [] for filename, data in sorted(files.items()): for error in data['errors']: stats.append(error['id']) # get the stats + stats_count += 1 stat_html = [] # the following lines sort the stat primary by value (occurrences), @@ -435,7 +437,7 @@ if __name__ == '__main__': stat_html.append(" " + str(dict(Counter(stats).most_common())[_id]) + " " + str(_id) + "
\n") output_file.write(HTML_HEAD.replace('id="menu" dir="rtl"', 'id="menu_index"', 1).replace("Defect list", "Defect summary", 1) % (options.title, '', options.title, '')) - output_file.write('

\n' + ''.join(stat_html) + '

') + output_file.write('

\n' + ' ' + str(stats_count) + ' total

\n' + ''.join(stat_html) + '

') output_file.write(HTML_HEAD_END.replace("content", "content_index", 1)) output_file.write(' \n') output_file.write(