I'm the author of the PMD plug-in for the Hudson CI server. My plug-in visualizes the PMD results of the current build as well as the trend report of several builds. In the trend report you will see the new and fixed warnings (current build vs. previous one).
Currently the computation of fixed and new warnings is based on simple attributes (line, message, type) of a PMD warning. However, this simple approach has some drawbackes, e.g. if someone adds some new lines of code above the affected line. Then I get a new warnings even if the warning is not new.
The findbugs team provides an additional information during their scan: they coumpute a unique hash value of a detected warning. The hash is some kind of "refactoring-resistant". Even if the line numbers (and surrounding code) is changed, the hash remains the same.
It would be cool if you could create such a hash also during the PMD parser process and add this value to the pmd.xml file. This would help me to provide a better detection of new and fixed bugs for my backend.
Logged In: YES
user_id=1373398
Originator: NO
This would imply that PMD keeps a violation database between runs. It's an interesting idea and should probably be on the TODO list at some point.
Unfortunately, we are currently in the process of a major refactoring for PMD 5.0 and so if/when we decide to implement this, it won't happen for a while...
Xavier
PS: nice work on the PMD plugin (and the other reporting plugins too :)
Well, actually I don't think that PMD needs to record something for several runs (findbugs does neither). It should be sufficient to compute a hash from the context where a warning has been found.
E.g. a simple first approach would be to use the hash code of the method name where the warning has been found and combine that with the hash code source code of the affected line and the violation ID. This could be done in each PMD run.
My backend can then read the hashes and compare them: if the hashes match then the warning is the same.
I'll have a look at the findbugs code how they compute these hashes.