pmd
pmd copied to clipboard
[apex] Flag ANY use of @SuppressWarnings or //NOPMD, not just unused ones
Proposed Rule Name: WarningSuppression
Proposed Category: Best Practices
Description: Should be available to all languages.
Flag ANY use of @SuppressWarnings or //NOPMD. Defaults to Sev5.
While this is a nuclear option, the ability to flag every use of suppression will ensure that devs don't do bad things and include an override.
Code Sample: This should include code, that should be flagged by the rule. If possible, the "correct" code according to this new rule should also be demonstrated.
List<Account> aList = [SELECT Id FROM Account WITH SYSTEM_MODE]; //NOPMD
Possible Properties:
- Should this rule be customizable via properties? It would be nice to have, for the annotation, a special string that would bypass this violation. In effect, a meta-suppression. This isn't ideal, but I think we need to have a way to flag things so PMD is a solid screening tool.