Bitbucket Cloud Integration

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:

Bitbucket repo overview

To enable this feature, in the repository overview go to Repository settings > SonarCloud > Settings and check Show repository overview widget:

Bitbucket cloud repo overview

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 a limitation of the current integration with Bitbucket.

Pull request view

When viewing an analyzed pull request you will see quality metrics displayed at the top, similar to what you see in the repository overview:

Bitbucket cloud PR quality

Additionally, the right sidebar contains a code insights section that provides access to code reports:

Bitbucket cloud PR sidebar

(To enable the right sidebar, go to Personal Settings > Features > Labs and enable New pull request experience.)

You expand this section and click on SonarCloud Code Analysis:

Bitbucket cloud expanded sidebar

This will bring up a full report of all the issues found in this pull request by SonarCloud:

Bitbucket cloud code report


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

FAQ

Do you have sample projects on Bitbucket Cloud? 

You can take a look at these various projects: Sample projects analyzed on SonarCloud.

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)

© 2008-2022, SonarCloud by SonarSource SA. All rights reserved.