0
votes

Background:

I'm part of a team that all work mostly on a single large codebase, and we use SonarQube to track our test coverage so we can drill into the area's of new/edited code that is missing tests to see if tests need adding.

The problem is, we have grown in terms of number of developers, so now we review SonarQube in our squads of 3-5 developers instead of the whole team of 20 developers. I would like to be able to filter the code coverage views down, so I can focus just on the code that a single squad changed, rather than the code that the whole dev team changed.

If it helps, we do work on different branches, and build squad based SonarQube projects off of the individual squad branches, but we regularly merge to share changes across squads, so SonarQube currently picks up all changes.

Question:

How do I filter code coverage down to just the code that was edited by 1-5 devs?

1

1 Answers

1
votes

My answer may not help you, but perhaps I can give you ideas of how to do this better.

I'm fairly certain there's no way to do what you're asking. It is true that SonarQube does have a REST api, so anything technically is possible, but you'd have to build all of that.

What I'd suggest as a better approach is ensuring that code is properly reviewed, including SonarQube results, BEFORE code is merged into the common codebase. You don't mention your SCM technology, but hopefully you're using git, and a central repository technology like BitBucket. If that's true, then you should be able to use pull requests to protect bad code from being merged. Your automated build system can integrate with BitBucket and SonarQube. In fact, if you're actually using BitBucket, then you can use the "Sonar" plugin in BitBucket to integrate SonarQube results directly into your pull request views, so you can see effective code coverage, duplications, and static analysis issues right in the pull request view.

This is a high level summary, but you can get the details when you drill down into these steps.