Menu

HTML report issues, fixes and changes

2021-12-12
2021-12-14
  • Alexander Festini

    After coming back to cppcheck after a while, since we needed a proper human readable report, I ran into some minor issues and eventually just fixed and changed a few things:

    • Filter by severity in addition to id (I just really missed that compared to the GUI)
    • Toggle All behavior no longer "flips" each filter, but sets all to the same state
    • layout changed to CSS grid (old browsers might struggle)
      • Horizontal scrollbar in code view no longer hidden at bottom of page
      • Footer always visible and shortened (browser info shouldn't cover the "important" parts anymore)
      • Tried to reduce extreme jumps in summary table layout when filtering
    • Filtering file if all issues in a file are filtered (the scrolling got annoying in large codebases)
    • Fixed git blame (path was never reset, source-dir was just overwritten, path always ended up wrong)
    • Removed author email (size, privacy and redundancy... can be added back in by removing a line comment)
    • Fixed double escaped entities (possible unexpected side effects, xml source should ALREADY be escaped)
    • Added yellow background for warnings (errors and warnings are usually the two important ones to act on)

    The modified file is attached in case anyone feels like testing it with their browser or wants to give feedback on which changes to push for.

     
  • Alexander Festini

    Minor update regarding git blame, since I didn't like the hard-coded dropping of fields. Since add-author-information was kind of a "enter whatever you want and it's True" anyway, I modified the parsing. You can now specify the fields and the order you want by using:
    --add-author-information=name,email,date (or short: n,e,d).

    If you use any unknown string, it will default to name, email, date to be backwards compatible with the original, otherwise it will use the specified fields in the given order, ie. if you only want the date and name in that order, you would use
    --add-author-information=d,n (or =date,name)

     

    Last edit: Alexander Festini 2021-12-13
  • Alexander Festini

    Done. Though I should point out again that it might cause issues with old browsers (IE and Edge 15 and less). Depending on whether that is an issue, it might make sense to keep the original generator next to this one.

     
  • Alexander Festini

    Looks like the double escaped entities were an issue in the XML itself and since fixed (making my workaround in the generator an even worse bug that produced invalid HTML).

    I had to change check_output to match the docs (worked on Windows, on Linux it tried to find a binary of the name of the entire command line).

    Also added tool filters to filter cppcheck and clang-tidy issues, so the report now has all the same filters as the GUI.

    https://github.com/afestini/cppcheck/blob/htmlreport_changes/htmlreport/cppcheck-htmlreport

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.