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

Excluded annotated methods cause invalid coverage on Sonar #576

Open
phcannesson opened this issue Mar 21, 2024 · 1 comment
Open

Excluded annotated methods cause invalid coverage on Sonar #576

phcannesson opened this issue Mar 21, 2024 · 1 comment
Assignees
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed

Comments

@phcannesson
Copy link

phcannesson commented Mar 21, 2024

I use Kover on an Android app that uses Compose for its UI.

As we don't really want (for now) to have coverage on Compose code, we've excluded the @Composable annotation.

But this causes files that contains only compose functions to be completely ignored, and therefore to be missing from reports (that apparently organize coverage per class).
Sonar unfortunately interprets this absence as "Uncovered".

On the other hand, if in the same file, we have a data class :

data class UIData(
    val someData: T
)

@Composable
fun MyComposable() {
    Text("some text")
}

then a report is created for this file/class and Sonar will understand and the MyComposable is ignored.

Is there some kind of support for this use case ? Maybe tell Kover to aggregate reports by file instead of class?
Or is it something to fix on our Sonar configuration ?

@phcannesson phcannesson added Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Mar 21, 2024
@shanshin
Copy link
Collaborator

Hi,
do you use XML report to integrate with Sonar?
It might be worth trying to set up Sonar, the XML format of the report is fixed and cannot be changed on our part.

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed and removed S: untriaged Status: issue reported but unprocessed labels Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants