How do I configure PMD to ignore missing constructor tests

I often have my students submit 100% static methods for testing.  How can I get PMD to ignore that they haven't tested the default constructor?

It keeps knocking off points saying that the class declaration has not been tested.

You can see in the example below, that all methods are static:


public class Silly // it sayd that this line of code was never tested... but how to you ignore it?


  public static int add(int a, int b)


    return a + b;





Jeremy W

I think what I want is this.  How do I add this to the PMD ruleset in webcat?


Since: PMD 1.0

This rule detects when a constructor is not necessary; i.e., when there's only one constructor, it's public, has an empty body, and takes no arguments.

This rule is defined by the following XPath expression: