Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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?

2 answers

1 accepted

0 votes
Answer accepted


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,


We recently upgraded sonar for bitbucket plugin to version 4.3.1 and upgraded bitbucket to version 7.6.5.

Before the Bitbucket upgrade, there was a setting on the Sonar plugin in the project settings to specify whether the analysis should be branch based vs. leak period.

I am no longer seeing this option after the upgrade. From the PRs, it seems like it’s using leak period by default. Is there a way to change it back to branch-based analysis?

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events