Update cppcheck-htmlreport.
* remove unneeded classes * remove non-existent background images * tweak properties * use the proper capitalization for "Cppcheck" and "HTML"
This commit is contained in:
parent
4cd2fad2bf
commit
a42177c2e5
|
@ -15,29 +15,20 @@ with syntax highlighted source code.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
STYLE_FILE = """
|
STYLE_FILE = """
|
||||||
body.body {
|
body {
|
||||||
font-family: Arial;
|
font: normal 13px/1 Arial, Verdana, Sans-Serif;
|
||||||
font-size: 13px;
|
|
||||||
background-color: black;
|
background-color: black;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
font-family: Arial;
|
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
background-color: #ffb7b7;
|
background-color: #ffb7b7;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-header {
|
|
||||||
clear: both;
|
|
||||||
width: 900px;
|
|
||||||
margin: 20px auto 0 auto;
|
|
||||||
height: 10px;
|
|
||||||
border-bottom: 2px solid #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
#page {
|
#page {
|
||||||
width: 860px;
|
width: 860px;
|
||||||
|
@ -48,18 +39,9 @@ body.body {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-footer {
|
|
||||||
width: 900px;
|
|
||||||
height: 10px;
|
|
||||||
clear: both;
|
|
||||||
margin: auto;
|
|
||||||
border-top: 2px solid #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header {
|
#header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 70px;
|
height: 70px;
|
||||||
background: url(logo.png) no-repeat left top;
|
|
||||||
border-bottom: thin solid #aaa;
|
border-bottom: thin solid #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,10 +61,8 @@ body.body {
|
||||||
#content {
|
#content {
|
||||||
float: left;
|
float: left;
|
||||||
width: 720px;
|
width: 720px;
|
||||||
|
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
padding: 0 10px 10px 10px;
|
padding: 0 10px 10px 10px;
|
||||||
|
|
||||||
border-left: thin solid #aaa;
|
border-left: thin solid #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,32 +71,25 @@ body.body {
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
border-top: thin solid #aaa;
|
border-top: thin solid #aaa;
|
||||||
clear: both;
|
clear: both;
|
||||||
font-size: 10px;
|
font-size: 90%;
|
||||||
}
|
|
||||||
|
|
||||||
#footer > div {
|
|
||||||
float: left;
|
|
||||||
width: 33%;
|
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
HTML_HEAD = """
|
HTML_HEAD = """
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>CppCheck - Html report - %s</title>
|
<meta charset="utf-8">
|
||||||
<link href="style.css" rel="stylesheet" type="text/css" />
|
<title>Cppcheck - HTML report - %s</title>
|
||||||
<style type="text/css">
|
<link href="style.css" rel="stylesheet">
|
||||||
|
<style>
|
||||||
%s
|
%s
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="body">
|
<body>
|
||||||
<div id="page-header">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="page">
|
<div id="page">
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<h1>CppCheck report - %s</h1>
|
<h1>Cppcheck report - %s</h1>
|
||||||
</div>
|
</div>
|
||||||
<div id="menu">
|
<div id="menu">
|
||||||
<a href="index.html">Defect list</a>
|
<a href="index.html">Defect list</a>
|
||||||
|
@ -127,20 +100,15 @@ HTML_HEAD = """
|
||||||
HTML_FOOTER = """
|
HTML_FOOTER = """
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<div>
|
<p>
|
||||||
CppCheck - a tool for static C/C++ code analysis
|
Cppcheck - a tool for static C/C++ code analysis
|
||||||
</div>
|
</p>
|
||||||
<div>
|
<p>
|
||||||
Internet: <a href="http://cppcheck.sourceforge.net">http://cppcheck.sourceforge.net</a><br/>
|
Internet: <a href="http://cppcheck.sourceforge.net">http://cppcheck.sourceforge.net</a><br/>
|
||||||
Forum: <a href="http://apps.sourceforge.net/phpbb/cppcheck/">http://apps.sourceforge.net/phpbb/cppcheck/</a><br/>
|
Forum: <a href="http://apps.sourceforge.net/phpbb/cppcheck/">http://apps.sourceforge.net/phpbb/cppcheck/</a><br/>
|
||||||
IRC: #cppcheck at irc.freenode.net
|
IRC: #cppcheck at irc.freenode.net
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="page-footer">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -213,7 +181,7 @@ if __name__ == '__main__':
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
parser.add_option("--title", dest="title", help="The title of the project.", default="[project name]")
|
parser.add_option("--title", dest="title", help="The title of the project.", default="[project name]")
|
||||||
parser.add_option("--file", dest="file", help="The cppcheck xml output file to read defects from. Default is reading from stdin.")
|
parser.add_option("--file", dest="file", help="The cppcheck xml output file to read defects from. Default is reading from stdin.")
|
||||||
parser.add_option("--report-dir", dest="report_dir", help="The directory where the html report content is written.")
|
parser.add_option("--report-dir", dest="report_dir", help="The directory where the HTML report content is written.")
|
||||||
parser.add_option("--source-dir", dest="source_dir", help="Base directory where source code files can be found.")
|
parser.add_option("--source-dir", dest="source_dir", help="Base directory where source code files can be found.")
|
||||||
parser.add_option("--source-encoding", dest="source_encoding", help="Encoding of source code.", default=None)
|
parser.add_option("--source-encoding", dest="source_encoding", help="Encoding of source code.", default=None)
|
||||||
|
|
||||||
|
@ -246,7 +214,7 @@ if __name__ == '__main__':
|
||||||
# We have a list of errors. But now we want to group them on
|
# We have a list of errors. But now we want to group them on
|
||||||
# each source code file. Lets create a files dictionary that
|
# each source code file. Lets create a files dictionary that
|
||||||
# will contain a list of all the errors in that file. For each
|
# will contain a list of all the errors in that file. For each
|
||||||
# file we will also generate a html filename to use.
|
# file we will also generate a HTML filename to use.
|
||||||
files = {}
|
files = {}
|
||||||
file_no = 0
|
file_no = 0
|
||||||
for error in contentHandler.errors:
|
for error in contentHandler.errors:
|
||||||
|
@ -261,7 +229,7 @@ if __name__ == '__main__':
|
||||||
if not os.path.exists(options.report_dir):
|
if not os.path.exists(options.report_dir):
|
||||||
os.mkdir(options.report_dir)
|
os.mkdir(options.report_dir)
|
||||||
|
|
||||||
# Generate a html file with syntax highlighted source code for each
|
# Generate a HTML file with syntax highlighted source code for each
|
||||||
# file that contains one or more errors.
|
# file that contains one or more errors.
|
||||||
print("Processing errors")
|
print("Processing errors")
|
||||||
for filename, data in files.items():
|
for filename, data in files.items():
|
||||||
|
|
Loading…
Reference in New Issue