@@ -628,6 +628,9 @@ def main() -> None:
628628 'from. You can combine results from several '
629629 'xml reports i.e. "--file file1.xml --file file2.xml ..". '
630630 'Default is reading from stdin.' )
631+ parser .add_option ('--checkers-report-file' , dest = 'checkers_report' ,
632+ help = 'The cppcheck checkers report file as produced '
633+ 'with the "--checkers-report" option of cppcheck.' )
631634 parser .add_option ('--report-dir' , dest = 'report_dir' ,
632635 help = 'The directory where the HTML report content is '
633636 'written.' )
@@ -855,6 +858,8 @@ def main() -> None:
855858 output_file .write ('\n <tr><td></td><td>' + str (stats_count ) + '</td><td>total</td></tr>' )
856859 output_file .write ('\n </table>' )
857860 output_file .write ('\n <p><a href="stats.html">Statistics</a></p>' )
861+ if options .checkers_report :
862+ output_file .write ('\n <p><a href="checkers.html">Checkers</a></p>' )
858863 output_file .write (HTML_MENU_END .replace ("content" , "content_index" , 1 ))
859864
860865 output_file .write ('\n <table class=\" summaryTable\" >' )
@@ -983,6 +988,26 @@ def main() -> None:
983988
984989 stats_file .write (HTML_FOOTER % contentHandler .versionCppcheck )
985990
991+ if options .checkers_report :
992+ print ("Creating checkers.html (checkers report)\n " )
993+
994+ with io .open (os .path .join (options .report_dir , 'checkers.html' ), 'w' ) as checkers_file :
995+
996+ checkers_file .write (HTML_HEAD % (options .title , '' , options .title , ': Checkers' ))
997+ checkers_file .write (HTML_HEAD_END )
998+
999+ checkers_file .write (HTML_MENU .replace ('id="menu"' , 'id="menu_index"' , 1 ).replace ("Defects:" , "Back to summary" , 1 ) % ('' ))
1000+ checkers_file .write (HTML_MENU_END .replace ("content" , "content_index" , 1 ))
1001+
1002+ with io .open (options .checkers_report , 'r' , encoding = options .source_encoding ) as checkers_report :
1003+ content = checkers_report .read ()
1004+
1005+ checkers_file .write ("<pre>\n " )
1006+ checkers_file .write (html_escape (content ))
1007+ checkers_file .write ("</pre>\n " )
1008+
1009+ checkers_file .write (HTML_FOOTER % contentHandler .versionCppcheck )
1010+
9861011 print ("\n Open '" + options .report_dir + "/index.html' to see the results." )
9871012
9881013
0 commit comments