Start FreeLog in
SonarCloud | Appendices | Bitbucket Cloud integration

Bitbucket Cloud integration

On this page

SonarCloud provides information about the current state of your code directly in the repository overview and pull request view of Bitbucket Cloud.

Repository Overview

In the repository overview (accessed by selecting Source in the left sidebar), the current quality metrics for the main branch can be displayed at the top of the page:

Screenshot of the BitBucket interface with the SonarCloud project analysis results widget.

To enable this feature, you must enable the widget. Go to Your Project > Your Repository > Repository settings > SonarCloud > Settings and select Show repository overview widget.

Screenshot of the Bitbucket interface showing how to enable the analysis overview widget.

Note that the quality widget in this Source view always shows the status for the master branch, even if you select another branch in the drop-down branch selector. This is a limitation of the current integration with Bitbucket.

Pull request view

When viewing an analyzed pull request you will see quality metrics displayed. The widget is similar to the repository widget and displays information related to the analysis of the pull request. 

Screenshot of the pull request quality gate widget in BitBucket.

Additionally, the right sidebar contains a code insights section that provides access to code reports. The keyboard shortcut to expand and collapse the right sidebar on repository pages is ].

Screenshot showing how to access code reports in the BitBucket interface sidebar.

You can expand the Report section and select SonarCloud Code Analysis to view a full report of all the issues SonarCloud found in the pull request:

Screenshot of the full report of all the issues found in the pull request by SonarCloud.

You don't have to navigate to sonarcloud.io because this view lets you see the issues identified by SonarCloud right in Bitbucket.

FAQ

Do you have sample projects on Bitbucket Cloud? 

I don't see the widget with quality information whereas I configured everything. 

  • Make sure that your browser is not using some extensions like AdBlocks. They tend to break the integration of third-party applications in Bitbucket Cloud.

Upcoming features and improvements

There are various areas in which you can expect new features and improvements:

  • Inline comments to show the issues within the pull request
  • Better and easier team onboarding
  • Automatic analysis (i.e. no need to configure anything from Pipelines)

Was this page helpful?

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License