You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello
When I run tests, I get a clover.xml file that contains tags and attributes like this:
<metrics conditionals="664" methods="117" classes="13" files="9" packages="1" coveredstatements="1554" complexity="710" loc="3620" ncloc="3203" coveredmethods="105" coveredconditionals="479" statements="1989" coveredelements="2138" elements="2770"/>
Among the attributes, we find methods and coveredmethods, statements and coveredstatements, ...
I'm interested in number of code lines, and the number of covered code lines.
Is there a way to have them in clover.xml, preferably in the same metrics tag?
Thanks in advance..
loc
=
"3620" is the number for Lines Of Code.
I think that ncloc
=
"3203" is the number for N
on-Comment Lines of Code as per https://confluence.atlassian.com/display/CLOVER/clover-report
Actually there is no point in "Covered Lines of Code" number. "Covered Statements" is very well describing the coverage.
Cheers,
Jacek
I see.
But can you please further explain why "cover lines of code" number is not a good metric for coverage? An example would be very appreciated.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see.
But can you please further explain why "cover lines of code" number is not a good metric for coverage? An example would be very appreciated.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are 3620 lines of code. Comments and empty lines cannot be covered so we can only consider lines with the real code to cover.
You have 1989 statements. Some of them probably span multiple lines so let's assume there are 2000 lines of code containing statements.
Next let's assume that all your code is covered (all 1989 statemetns and thus all 2000 lines). It means that your code is fully covered (1989 statements in total / 1989 statements covered = 100%). This is very good existing metric.
On the other hand there are: 2000 lines with code covered / 3620 lines in total = 55%. If you add more comments or empty lines (e.g. licensing information) then the number will drop below 55% while still all your code will be covered.
This 55% simply says nothing.
In order to make it reasonable we would need to find "number of lines containing statements" and compare with "number of covered lines containing statements" to get meaningfull 100% - but this is actually duplicate of what we have now: number of statements and number of covered statements.
Does this answer your question?
Cheers,
Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raphael,
doesn't "loc=3620" represent your (covered) lines of code and "ncloc3203" the uncovered LOC?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Back in April of last year one of the major product announcements from Opsgenie was the launch of the Incident investigation view which created a deep connection between Bitbucket and Opsgenie, empow...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.