Upgrade to PMD 6
PMD 6 includes useful stuff like allowing annotations in the code to suppress warnings. It would be great to be on that version.
Stephen told me via the support chat that it wasn't simple to just upgrade, so I thought I would submit it as a feature request.
Hi Aidan,
We’ve now upgraded to PMD 6.3 which includes support for suppressing warnings.
Regards,
Stephen
-
Hi Eric,
The team is totally bought into the need/benefits of this enhancement, and if it had been a simple change then it would have been almost immediately done.
I don't have a likely ETA at the moment - but I'll make sure to update this post as soon as any work is scheduled to make all the changes required to support PMD6.
-
[Deleted User] commented
I second this request. In a sophisticated environment using frameworks, patterns, etc (like Force.com Enterprise Architecture), some of the PMD warnings are spurious and need suppressing. For example, in the Selector layer, you are supposed to inherit sharing from the calling class, hence
public class FoosSelector {..} will throw a PMD violation ApexSharingRules that is spurious. The way to avoid this is with:
@SuppressWarnings('PMD.ApexSharingViolations')
public class FoosSelector {..}but this requires PMD 6.0 or higher; Gearset is at PMD 5.8
If you are using an IDE like IlluminatedCloud where you can install any PMD version, you are likely to install the latest (6.1) and be out of sync with Gearset.