You can write new Rules with PMD.
In your case, new XPath Rules would be adequate to quickly examine the AST (Abstract Syntax Tree) and perform the kind of detection you need.
So you can declare new ruleset and integrate them in your eclipse along with your PMD plugin.
Note: PMD stands for many things ;)
We've been trying to find the meaning of the letters PMD - because frankly, we don't really know. We just think the letters sound good together.
- Pretty Much Done
- Project Mess Detector
- Project Monitoring Directives
- Project Meets Deadline
- Programming Mistake Detector
- Pounds Mistakes Dead
- PMD Meaning Discovery (recursion, hooray!)
- Programs of Mass Destruction
- Programming Meticulous coDe
- A 'Chaotic Metal' rock band name