Make code quality plugins coherent, and separate xml and html reports

I tried using these three code quality plugins: findbugs, pmd, and checkstyle. All basically do the same things: use a config file, check the source or byte code, and generate reports. However, they don’t follow the same rules:

  • checkstyle needs a config file to be present, and makes the build fail otherwise. The other two plugins use a default configuration.

  • findbugs generates xml OR html. PMD generates both by default. Checkstyle generates only XML. They should all be able to generate both types, IMHO, and should have the same default

Moreover, I would find it much cleaner to have html reports generated in a html subdirectory, and xml reports to be generated in an xml subdirectory. This would make other tasks (publishing to sonar, zipping, etc.) easier to develop. Moreover, if other future plugins (please support cobertura!) adopt the same strategy, it will be even more important because they might generate a whole lot of xml and html files. Cobertura, for example, generates one html file per class.

What you’re seeing are side effects of the underlying tool and their Ant implementations. I completely agree that Gradle, as a wrapper, could do something to clean up these tools, though diverging from their native behavior might even more confusing to users who are very familiar with the tools.

I think this is a good idea though, and you should file a Gradle bug to have them followup on putting the output into appropriate directories.

I’d recommend filing bugs against the 3rd party tools directly, e.g. checkstyle really should work with an internal default config like sun_checks.xml, and findbugs should be able to do two formats at once.

I’ve split this up into separate pieces:

I’m closing this off as “not planned” because it duplicates those other separate tickets (that are planned). If that’s not a fair representation of you idea then please let us know.