Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Clover: How Branch,stmt,Method and Total is calculated? These are as per LOC/NCLOC ?

Clover: how Branch,stmt,Method and Total is calculated?

Does these calculated with respect to LOC or NCLOC?

Please help me in understanding the how the above things are calculated with some sample .java file.

2 answers

0 votes

Hello Sai,

Please have a look at this page:

https://confluence.atlassian.com/display/CLOVER/About+Clover+code+metrics

Do not hesitate to ask if you have any questions.

Cheers
Marek

Hi Marek,

Thanks for quick reply.

Can you please let me know "Branch, stmt, Method and Total are caluclated against LOC or NCLOC?

Thanks,

Ranga

0 votes

Hello Sai,

Please note that Clover does not measure code coverage per source line - no matter whether we're talking about LOC or NCLOC. What Clover measures is a code coverage of real code structures, such as branches, statements and methods.

It means that you can see for instance:

  • a number of statments in a method, class, package or a whole project
  • a number of classes in a file, package or a whole project
  • etc

You might wonder "how the statement coverage metric provided by Clover relates to the line coverage metric provided by other coverage tools such as Cobertura or EMMA". The answer is:

A single statement can span over several source lines; it is also possible to have several statements in a single source line. Therefore there is no 1:1 mapping between a statement coverage and a line coverage. Nevertheless, both metrics provide a similar granularity of a coverage measurement.

One more thing: in the Clover report you can define your own code metrics; they could include LOC/NCLOC information. See:

https://confluence.atlassian.com/display/CLOVER/clover-report#clover-report-Columns

Cheers
Marek

Thanks for the support, you can close the issue.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Happy New Year and Welcome New Marketplace Partner Program Partners!

Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...

529 views 7 20
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you