diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport index 1a81367e5..3c86d2b40 100755 --- a/htmlreport/cppcheck-htmlreport +++ b/htmlreport/cppcheck-htmlreport @@ -48,12 +48,12 @@ h1 { } .inconclusive { - background-color: #B6B6B4; + background-color: #b6b6b4; } .inconclusive2 { - background-color: #B6B6B4; - border: 1px dotted black; + background-color: #b6b6b4; + border: 1px dotted #000; display: inline-block; margin-left: 4px; } @@ -71,8 +71,8 @@ div.verbose div.content { margin: 4px; max-width: 40%; white-space: pre-wrap; - border: 1px solid black; - background-color: #FFFFCC; + border: 1px solid #000; + background-color: #ffffcc; cursor: auto; } @@ -114,21 +114,21 @@ div.verbose div.content { z-index: 1; } -#filename { +#filename { margin-left: 10px; font: 12px; z-index: 1; } .highlighttable { - background-color:white; + background-color: #fff; z-index: 10; position: relative; margin: -10 px; } #content { - background-color: white; + background-color: #fff; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; @@ -141,7 +141,7 @@ div.verbose div.content { } #content_index { - background-color: white; + background-color: #fff; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; @@ -155,7 +155,7 @@ div.verbose div.content { .linenos { border-right: thin solid #aaa; - color: lightgray; + color: #d3d3d3; padding-right: 6px; } @@ -173,7 +173,7 @@ div.verbose div.content { """ HTML_HEAD = """ - + @@ -182,93 +182,107 @@ HTML_HEAD = """ - - - - + """ -HTML_ERROR = "<--- %s\n" -HTML_INCONCLUSIVE = "<--- %s\n" +HTML_ERROR = "<--- %s\n" +HTML_INCONCLUSIVE = "<--- %s\n" -HTML_EXPANDABLE_ERROR = "\n""" -HTML_EXPANDABLE_INCONCLUSIVE = "\n""" +HTML_EXPANDABLE_ERROR = "
<--- %s [+]
%s
\n""" +HTML_EXPANDABLE_INCONCLUSIVE = "
<--- %s [+]
%s
\n""" # escape() and unescape() takes care of &, < and >. html_escape_table = { @@ -518,7 +532,7 @@ if __name__ == '__main__': filename.split('/')[-1])) for error in sorted(errors, key=lambda k: k['line']): - output_file.write(" %s %s" % (data['htmlfile'], error['line'], error['id'], error['line'])) + output_file.write(" %s %s" % (data['htmlfile'], error['line'], error['id'], error['line'])) output_file.write(HTML_HEAD_END) try: @@ -528,8 +542,8 @@ if __name__ == '__main__': lexer = guess_lexer(content) except ClassNotFound: sys.stderr.write("ERROR: Couldn't determine lexer for the file' " + source_filename + " '. Won't be able to syntax highlight this file.") - output_file.write("\n Could not generated content because pygments failed to retrieve the determine code type.") - output_file.write("\n Sorry about this.") + output_file.write("\n Could not generate content because pygments failed to determine the code type.") + output_file.write("\n Sorry about this.") continue if options.source_encoding: @@ -572,7 +586,7 @@ if __name__ == '__main__': except IndexError: cnt_min = 0 - stat_fmt = "\n {}{}" + stat_fmt = "\n {}{}" for occurrences in reversed(range(cnt_min, cnt_max + 1)): for _id in [k for k, v in sorted(counter.items()) if v == occurrences]: stat_html.append(stat_fmt.format(_id, _id, dict(counter.most_common())[_id], _id)) @@ -591,16 +605,16 @@ if __name__ == '__main__': output_file.write('\n LineIdCWESeverityMessage') for filename, data in sorted(files.items()): if filename in decode_errors: # don't print a link but a note - output_file.write("\n %s" % (filename)) - output_file.write("\n Could not generated due to UnicodeDecodeError") + output_file.write("\n %s" % (filename)) + output_file.write("\n Could not generated due to UnicodeDecodeError") else: if filename.endswith('*'): # assume unmatched suppression output_file.write( - "\n %s" % + "\n %s" % (filename)) else: output_file.write( - "\n %s" % + "\n %s" % (data['htmlfile'], filename)) for error in sorted(data['errors'], key=lambda k: k['line']): @@ -614,7 +628,7 @@ if __name__ == '__main__': try: if error['cwe']: - cwe_url = "" + error['cwe'] + "" + cwe_url = "" + error['cwe'] + "" except KeyError: cwe_url = "" @@ -686,7 +700,7 @@ if __name__ == '__main__': continue except KeyError: continue - stats_file.write("

Top 10 files for " + sev + " severity, total findings: " + str(_sum) + "
\n") + stats_file.write("

Top 10 files for " + sev + " severity, total findings: " + str(_sum) + "
\n") # sort, so that the file with the most severities per type is first stats_list_sorted = sorted(stats_templist.items(), key=operator.itemgetter(1, 0), reverse=True) @@ -699,7 +713,7 @@ if __name__ == '__main__': if (it == 0): LENGTH = len(str(i[1])) # <- length of longest number, now get the difference and try to make other numbers align to it - stats_file.write(" " * 3 + str(i[1]) + " " * (1 + LENGTH - len(str(i[1]))) + " " + i[0] + "
\n") + stats_file.write(" " * 3 + str(i[1]) + " " * (1 + LENGTH - len(str(i[1]))) + " " + i[0] + "
\n") it += 1 if (it == 10): # print only the top 10 break