jacoco-plugin icon indicating copy to clipboard operation
jacoco-plugin copied to clipboard

Changed rendering of percentgraph

Open simedw opened this issue 12 years ago • 11 comments

The bars indicating code coverage were a tad confusing so I changed them:

  • All bars are always 100px wide.
  • Starts with green, then red.
  • Percentage of the red bar is calculated as
missed / (covered + missed)

simedw avatar Sep 11 '13 20:09 simedw

Jenkins » jacoco-plugin #98 SUCCESS This pull request looks good (what's this?)

buildhive avatar Sep 11 '13 20:09 buildhive

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

jenkinsadmin avatar Sep 12 '13 00:09 jenkinsadmin

Similar to how JaCoCo's HTML generator handles the size of the bars, these shouldn't be 100px each - the more code a package has (as in, lines, methods, etc.) the longer the bar should be.

Likewise JaCoCo has red first, then green.

Your statement abotu the percentage of the red bar is absolutely valid and should be changed.

mabako avatar Sep 16 '13 12:09 mabako

I definitely see why it would be good to keep the behavior similar to the main HTML generator of Jacoco...

But after introducing Jacoco at work almost everyone complained that the bars were more or less unusable since sometimes there were too small to actually be rendered and many found them unintuitive.

Would it be okay if I made this into an optional setting? 

— Sent from Mailbox for iPhone

On Mon, Sep 16, 2013 at 5:37 AM, mabako [email protected] wrote:

Similar to how JaCoCo's HTML generator handles the size of the bars, these shouldn't be 100px each - the more code a package has (as in, lines, methods, etc.) the longer the bar should be.

Likewise JaCoCo has red first, then green.

Reply to this email directly or view it on GitHub: https://github.com/jenkinsci/jacoco-plugin/pull/29#issuecomment-24506533

simedw avatar Sep 16 '13 13:09 simedw

I believe so - though @ognjenb would know better as he's the plugin maintainer.

mabako avatar Sep 16 '13 14:09 mabako

Of course, an optional setting would be good. Do you want to change on the pull request, or I should check the existing?

ognjenb avatar Sep 16 '13 17:09 ognjenb

@simedw Do you have time maybe to work on this optional feature?

ognjenb avatar Jan 01 '14 18:01 ognjenb

The coverage bars show percentages. So there's absolutely no need to let their width vary.

There are even cases where the varying width renders the coverage report completely useless, as can be seen here: https://issues.jenkins-ci.org/browse/JENKINS-23588

avix avatar Jul 19 '14 13:07 avix

Waiting for a fix for some years now. Hope we will see useful Jacoco coverage reports some day.

https://issues.jenkins-ci.org/browse/JENKINS-23588

veita avatar Apr 25 '17 20:04 veita

@veita From what I read here, there is not even a clear understanding how the report should look like. So without a spec we all agree on we will not see any progress here. (Beside the fact that we need somebody who is willing to implement it. Maybe you?)

mheinzerling avatar Apr 26 '17 03:04 mheinzerling

Just use https://plugins.jenkins.io/code-coverage-api/ which support jacoco out of the box then you will have graph that looks like this:

summary-chart

See more details at https://www.jenkins.io/blog/2018/08/17/code-coverage-api-plugin-1/

endertunc avatar Oct 08 '20 13:10 endertunc