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": if name != "error":
return return
if attributes["id"] == "missingInclude": try:
self.errors.append( file = attributes["file"]
{ line = int(attributes["line"])
"file" : "", except:
"line" : 0, file = ""
"id" : attributes["id"], line = 0
"severity" : attributes["severity"], if attributes["id"] != "missingInclude" and attributes["id"] != "toomanyconfigs":
"msg" : attributes["msg"]
})
else:
if attributes["file"] == "":
sys.stderr.write("ERROR: cppcheck error reported without a file name.\n") sys.stderr.write("ERROR: cppcheck error reported without a file name.\n")
self.errors.append(
{ self.errors.append(
"file" : attributes["file"], {
"line" : int(attributes["line"]), "file" : file,
"id" : attributes["id"], "line" : line,
"severity" : attributes["severity"], "id" : attributes["id"],
"msg" : attributes["msg"] "severity" : attributes["severity"],
}) "msg" : attributes["msg"]
})
if __name__ == '__main__': if __name__ == '__main__':
# Configure all the options this little utility is using. # Configure all the options this little utility is using.