This documentation is for Clover 3.2.x View the latest version of

Unknown macro: {spacejump}

or visit the current Clover documentation home page.

Changes in Clover-for-Ant 3.1.10

January 8, 2013

This is a bug fix release which addresses issues found in 3.1.8 and earlier versions of Clover-for-Ant.

 

Improvements

1) Two new metrics have been implemented for method context filter:

  • maxAggregatedStatements
  • maxAggregatedComplexity

These two metrics calculate method statements/complexity including the code of all anonymous inline classes declared inside the method. Thanks to this it is possible to distinguish between trivial single-statement methods like:

int getNumber() { 
   return this.number;
}

and single-statement methods which actually return more complex data, like:

ActionListener getListener() {
   return new ActionListener() {
       public void actionPerformed(ActionEvent e) {
           System.out.println("statement #1");
           System.out.println("statement #2");
           System.out.println("statement #3");
       }
   }; 
}

 

In the code sample above, the getListener() method has only one statement: "return new ActionListener()". If you would use a method context filter with maxStatements attribute, like:

<methodContext name="trivial" regexp=".*" maxStatements="1">

then the whole method would be filtered-out (because it contains one "return" statement). If you would use new maxAggregatedStatements, for instance:

<methodContext name="trivial" regexp=".*" maxAggregatedStatements="1">

then the getListener() method would not be filtered out (because it contains 4 statements in total - 1 "return" statement from the method itself and 3 "System.out.println()" statements from anonymous class).

 

2) The <testsources> tag from <clover-setup> task is now passed to <groovyc> Ant task. Thanks to this you can define custom test detection rules for Groovy code. See clover-setup task for more details.

 

JIRA issue list

type key summary priority

Data cannot be retrieved due to an unexpected error.

View these issues in Jira

See also change log for Clover-for-Maven, Clover-for-Eclipse, Clover-for-IDEA.

  • No labels