Clover : Statement and Method codecoverage

In the nice html code coverage that clover generates , I did not see any specific code coverage for method and statement. I just have one number that is overall code coverage. I believe we would like to get the individual percentage for method and statement. I was actually surprised to find not to find one on the code coverage report. Do people use method or statement code coverage , if so how can I get it through clover html coverage report.

2 answers

1 accepted

This widget could not be displayed.

If you would like to customize Clover report in Maven, please read this article:

https://confluence.atlassian.com/display/CLOVER/Creating+custom+reports

This widget could not be displayed.

Hi Girish,

Yes, it's possible to have extra coverage metrics in the HTML report. You have to use <clover-report> task and declare the <current>/<columns> element in it.

For example:

&lt;clover-report&gt;
   &lt;current outfile="report/html"&gt;
      &lt;format type="html"/&gt;
      &lt;columns&gt;
         &lt;coveredMethods format="%"/&gt;
         &lt;coveredStatements format="%"/&gt;
         &lt;coveredBranches format="%"/&gt;
         &lt;coveredElements format="bar"/&gt;
      &lt;/columns&gt;
   &lt;/current&gt;
&lt;/clover-report&gt;

Cheers
Marek

Thanks , I will try this out. So this part will go in the pom right ? and I assume this extra data will be in addition to normal report will generate.

So this part will go in the pom right?

No, the snippet above is for Ant. For Maven, see my second answer.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

135 views 16 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you