Why Sonar for Bitbucket default to Leak period instead of branch-based, which one is better?

I have been using Sonar for Bitbucket for some time and all proejcts has been configured to use branch-based anlaysis (e.g. compare feature branch vs a main develop branch). Recently we have upgraded both SonarQube and this plug-in and it seems all the repo has changed to default to Leak period instead. From description it is comparing against the last release, a couple of question:

1) how does it know when it is the leak period to compare against?

2) is it better / recommended that we use leak period instead of branch based? From branch based, it seems we can find out exactly what technical debt or issues have been introduced in this feature branch into the main development branch, isn't that a more useful approach?

1 answer

1 accepted

Hi,

Since version 1.11 of the plug-in, the default is "branch-based" mode. If your default is now leak period suddenly, then this is a bug. What do you see in the repository settings of the plug-in?

Regarding your other questions:

1) The plug-in just uses the last leak period available to compare against. This can be either the last version of your project if you are using -Dsonar.timemachine.period1=previous_version or the last analysis when using -Dsonar.timemachine.period1=previous_analysis.

2) It really depends on your workflow. There are teams that do not analyze their target branches but only the source branches of their pull request. In this case, it makes sense to use leak period mode. For other teams, branch-based mode is better because they clearly see what new issues will be really introduced with a feature branch. 

Please let us know if you have further questions.

Best regards,

Michael

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

361 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you