Fixed htmlreport (#5068)

This commit is contained in:
PKEuS 2013-10-05 12:20:25 +02:00
parent db4ca13184
commit 53adafb1f2
1 changed files with 16 additions and 19 deletions

View File

@ -172,26 +172,23 @@ class CppCheckHandler(XmlContentHandler):
if name != "error":
return
if attributes["id"] == "missingInclude":
self.errors.append(
{
"file" : "",
"line" : 0,
"id" : attributes["id"],
"severity" : attributes["severity"],
"msg" : attributes["msg"]
})
else:
if attributes["file"] == "":
try:
file = attributes["file"]
line = int(attributes["line"])
except:
file = ""
line = 0
if attributes["id"] != "missingInclude" and attributes["id"] != "toomanyconfigs":
sys.stderr.write("ERROR: cppcheck error reported without a file name.\n")
self.errors.append(
{
"file" : attributes["file"],
"line" : int(attributes["line"]),
"id" : attributes["id"],
"severity" : attributes["severity"],
"msg" : attributes["msg"]
})
self.errors.append(
{
"file" : file,
"line" : line,
"id" : attributes["id"],
"severity" : attributes["severity"],
"msg" : attributes["msg"]
})
if __name__ == '__main__':
# Configure all the options this little utility is using.