medic/cht-android

PMD Processing errors for files that are not `.java`

Closed this issue · 0 comments

Describe the issue
Currently, when generating PMD reports, the resulting HTML/XML files are 7.6 MB in size! 😱 This seems to be due to the fact that the reports include stacktraces for each of the "Processing errors" that were encountered (one for each file that PMD could not parse). It appears that the PMD Gradle plugin by default only supports parsing .java files and since we are just trying to parse everything in src/ it is also trying to read all the images/xml/etc.

Describe the improvement you'd like

PMD, itself. supports parsing XML, but this has to be specially configured for the Gradle plugin. It would be nice to set that up and then exclude all the images and other files we do not want to parse.

Describe alternatives you've considered

A different approach would be to exclude all the res files from being parsed so that only .java are picked up as source for PMD, but this does not allow for analyzing the XML files.