CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

Minor improvements for the HTML report

Open zspitzer opened this issue 7 years ago • 7 comments

The HTML report is a bit more verbose than it needs to be

Variable user_id is not declared with a var statement. Use var or the local scope, or otherwise clarify the scope

In file C:\Users\zac\Documents\GitHub\CFLint\build\libs.\linenumber.cfm, line 2

At line: 2, at column: 2

In function test()

Expression: user_id

  • line number is repeated twice, may add the column number to the file reference and remove the At line: 2, at column: 2 line and extra new line?
  • the variable user_id could be made bold for clarity
  • expression (i.e. code snippets) could be wrapped in <pre></pre>
  • 'In file' is kind redundant before to the file path
  • does the warning need to be repeated in the details section, it's already the warning column?

Variable user_id is not declared with a var statement. Use var or the local scope, or otherwise clarify the scope

C:\Users\zac\Documents\GitHub\CFLint\build\libs.\linenumber.cfm, line 2, column 2

In function test()

Expression: user_id

zspitzer avatar Jul 30 '17 04:07 zspitzer

Ha, nothing is easy sometimes.

So, the HTML report gets created by XSLT from Findbugs XML which itself comes out of CFLint XML by XSLT. sigh :-)

In a nutshell - some of the blurbs I get to get into the HTML report can't be easily changed.

I made two small fixes:

  • does the warning need to be repeated in the details section, it's already the warning column?
  • 'In file' is kind redundant before to the file path

The other items I'll get back to in the output/report rewrite for 2.0.

TheRealAgentK avatar Jul 30 '17 06:07 TheRealAgentK

@zspitzer Can you please try with the recent changes and check that I didn't break anything essential along the way? :)

Sorry, not idea fix, it's just deferred for a bit.

TheRealAgentK avatar Jul 30 '17 06:07 TheRealAgentK

Changed milestone to 2.0 for the remaining bits of @zspitzer's suggestion

TheRealAgentK avatar Jul 30 '17 06:07 TheRealAgentK

just tried it, all working fine, thanks!

one last thing which would be good is to omit the full path when a relative path is defined

so C:\Users\zac\Documents\GitHub\CFLint\build\libs.\linenumber.cfm, line 2 becomes .\linenumber.cfm, line 2

zspitzer avatar Jul 30 '17 07:07 zspitzer

also, shouldn't summary break down warnings by type? rather than just a single row for CFLint Warnings

zspitzer avatar Jul 31 '17 04:07 zspitzer

Yes, it should. That's kind of a default behaviour because the XSL templates for the HTML reports are pretty much 1:1 taken from the Findbugs project, but they manage the underlying data differently. I'll have a quick look if there's an easy fix for that we can throw in now.

TheRealAgentK avatar Jul 31 '17 05:07 TheRealAgentK

Fixed that @zspitzer

TheRealAgentK avatar Jul 31 '17 23:07 TheRealAgentK