novoda/gradle-static-analysis-plugin

Allow to disable Findbugs HTML reports creation

danybony opened this issue · 6 comments

As mentioned in #74, every time we run check a GenerateFindBugsHtmlReport task is created and run.
While this is good when running the plugin on a dev machine, it's just wasting time when it's running on a CI where there are other ways to display the checks report (for example using the Pull Request Builder plugin).

It would be good to have an option to enable/disable the html report directly in the findbugs configuration closure.

@mr-archano do you know why are we not using findbugs's HTML report creation? Is the official one not working correctly?

The problem is that Findbugs doesn't support both XML and HTML reports at the same time.
The current implementation of each tool configurator enables both XML and HTML reports, so for Findbugs we have decided to add an additional task that is using Findbugs own facilities to generate the HTML report from the XML.

I am not sure I would agree on the "wasting time" part in this issue, as that task should be fairly fast but I haven't done any profiling in order to confirm that.

At least it is cache able now as of version 0.7 🎉

If you set to 0 warnings and occasionally have 1 or 2 then it is fast. But for example we have around 300 warnings in our legacy module. It creates a really big HTML page. I would say it takes around 15-20 seconds.

I would say it takes around 15-20 seconds.

DAYUMMM. Had no idea 🙈

it's probably worth finding a way to use the reports {} configuration, as the idea of having HTML reports always on was just to make the violations more human-readable.

Yep, that's a good idea. Could be set to enabled by default. If the user puts reports.html.enabled = false then we could skip the task.

Support to disable html generation is now added. You can disable it by adding htmlReportEnabled false under your findbugs integration.

Will go live with the next version and is available now with the latest snapshot