Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch and Instruction Line Coverage for Violations Checker Ant task #1340

Closed
kingargyle opened this issue Jun 29, 2022 · 3 comments
Closed

Comments

@kingargyle
Copy link

Scenario

  • JaCoCo version: 0.8.8
  • Operating system: any
  • Tool integration: Ant / Gradle / Maven

Description:

Currently for Bundle coverage we only have to ability to represent Branch, Instructions, Methods, Class, etc levels of coverage for the violation rules. In order to help match up with the way Sonar reports code coverage, as documented at the following link:

https://community.sonarsource.com/t/sonarqube-and-code-coverage/4725#how-to-calculate-code-coverage-4

It would be nice to have another option for the combined calculation of Branch and Instruction/Line Coverage. This would help closer align what the developer sees and what sonar itself is reporting. Or if there was a way to configure the Violation rules to take the aggregrate of several coverge metrics that would be even better and more flexible.

Current Behaviour

No way to combine Instruction and Branch coverage for an overall coverage

Wanted Behaviour

Ability to specify multiple metrics to consider as a whole.

Possible Workarounds

None

@marchof
Copy link
Member

marchof commented Jun 30, 2022

JaCoCo uses standard definitions widely adopted in the industry.

We will not incorporate additional proprietary definitions of other tools. Based on our XML reports you can create tooling to calculate any metrics. Or you use SonarQube directly if you want to see their metrics

@kingargyle
Copy link
Author

Thanks. I figured it was a long shot. I should be able to create a gradle task based on the xml data to possibly meet our internal needs.

@marchof
Copy link
Member

marchof commented Jun 30, 2022

JaCoCo is has an public API and is released as Maven artifacts. You could even use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants