Fixed htmlreport (#5068)
This commit is contained in:
parent
db4ca13184
commit
53adafb1f2
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue