FlexPMD: Tips and Tricks

While RC4 is on its way, I would like to share some tips about FlexPMD:

Default ruleset
Some people were asking why there were no default rulesets in the archives. There is a simple reason: if you don’t specify any ruleset, the default one is loaded. The default ruleset contains every rule implemented.

Acknowledge violations
FlexPMD finds “possible” problems. It is possible that a violation for FlexPMD, has been done on purpose by the developer. So if you want to acknowledged a violation, just append // NO PMD at the end of the line. This specific violation will be ignored by FlexPMD.

Maven repository
While FlexPMD artefacts, are not (yet) deployed on a public repository, if you want to used FlexPMD with Maven, you will need to download the sources and install the artifacts in your repository.

Fine tuned ruleset
When using the ruleset creator, you can either remove a rule, modify it (changing the message, the description, or its level).

Let’s say you decide, that if any rule with a high level is broken, then you want the build to be refused.

There is an extra argument in the Maven target, and the Ant task, called failOnError, which makes the build failing if an error violation is found.

Then in your favorite Continuous Integration server, the build would be broken just like if there is a compilation error, or a failing unit-test.

Let’s build high quality software…