Reputation: 7327
I have taken a look at the PMD api which I want to use to detect unused instance variables and methods in a class. I see that it can be invoked from the command line, however I would like to perform a redundancy analysis of my class by invoking PMD programatically. Unfortunately, the api doesn't contain any information regarding the various classes and methods. Does anyone have any information regarding how PMD can be invoked to detect redundant code programatically?
Upvotes: 0
Views: 1038
Reputation: 139921
Do you mean invoke it as a part of your build? It wouldn't make much sense to invoke PMD to analyze the source code during the runtime of the actual application.
Take a look at maven-pmd-plugin or the Ant task.
Upvotes: 1