From 31a0e35ef2dc4cfacd1efa466d353e72e23359ca Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 17 Oct 2013 15:49:48 +0300 Subject: [PATCH] Tweak cppcheck-htmlreport. Move style to a class and tweak properties. --- htmlreport/cppcheck-htmlreport | 67 ++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport index 3d998f75f..ce9690d71 100755 --- a/htmlreport/cppcheck-htmlreport +++ b/htmlreport/cppcheck-htmlreport @@ -21,79 +21,89 @@ with syntax highlighted source code. STYLE_FILE = """ body { - font: normal 13px/1 Arial, Verdana, Sans-Serif; background-color: black; - padding: 0; + font: 13px Arial, Verdana, Sans-Serif; margin: 0; + padding: 0; } .error { - font-size: 13px; background-color: #ffb7b7; - padding: 0; margin: 0; + padding: 0; } +.error2 { + background-color: #faa; + border: 1px dotted black; + margin-left: 4px; + margin-top: 4px; + padding: 1px +} #page { - width: auto; - margin: 30px; - border: 2px solid #aaa; background-color: white; - padding: 20px; + border: 2px solid #aaa; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + margin: 30px; overflow: auto; + padding: 5px 20px; + width: auto; } - #header { - width: 100%; - height: 70px; border-bottom: thin solid #aaa; } #menu { + float: left; margin-top: 5px; text-align: left; - float: left; width: 100px; height: auto; } #menu > a { - margin-left: 10px; display: block; + margin-left: 10px; } #content { + border-left: thin solid #aaa; float: left; - width: 80%; margin: 5px; padding: 0 10px 10px 10px; - border-left: thin solid #aaa; + width: 80%; } .linenos { - color: #bbb; - padding-right: 6px; - border-right: thin solid #aaa; + border-right: thin solid #aaa; + color: #bbb; + padding-right: 6px; } #footer { - padding-bottom: 5px; - padding-top: 5px; border-top: thin solid #aaa; clear: both; font-size: 90%; + margin-top: 5px; +} + +#footer ul { + list-style-type: none; + padding-left: 0; } """ HTML_HEAD = """ - + Cppcheck - HTML report - %s - + @@ -115,18 +125,18 @@ HTML_FOOTER = """

Cppcheck - a tool for static C/C++ code analysis

-

- Internet: http://cppcheck.sourceforge.net
- Forum: http://apps.sourceforge.net/phpbb/cppcheck/
- IRC: #cppcheck at irc.freenode.net -

+ """ -HTML_ERROR = "<--- %s\n" +HTML_ERROR = "<--- %s\n" class AnnotateCodeFormatter(HtmlFormatter): @@ -145,6 +155,7 @@ class AnnotateCodeFormatter(HtmlFormatter): class CppCheckHandler(XmlContentHandler): + """Parses the cppcheck xml file and produces a list of all its errors.""" def __init__(self):