Static code analysis in your Bitbucket repositories

Sonar tightly integrates with Bitbucket enabling your team to consistently and efficiently deliver Code Quality that enriches your workflows with static code analysis to identify issues.

SONAR CI/CD INTEGRATION FEATURES FOR BITBUCKET

Extended Bitbucket experience enhanced code quality

Enhance your Bitbucket experience with Sonar and ensure only Code Quality will be added to the code base. With just a few clicks you're up and running right where your code lives.

Header image
code

Pull request decoration

Sonar automatically decorates code quality metrics directly on your pull requests & feature branches. Resolve issues before you merge, making code reviews more effective and streamlined. 

code merge

Go/no-go Quality Gate

Fail your Bitbucket pipelines when the quality of code doesn’t meet your defined requirements making static code analysis a crucial step in your development process. Code Quality becomes the norm!

feedback

Code review

Review and prioritize issue remediation during code reviews directly from Bitbucket, fostering a proactive approach towards code quality enhancement.

code so pristine it sparkles

Monorepo support

Configure multiple Quality Gates and receive project-labeled messages in your Bitbucket mono repository, ensuring code quality standards are met across all projects.

Integrate Bitbucket with Sonar now!

EASY ONBOARDING, INSTANT VALUE

Built-in features make code quality, review and analysis a snap!

developer

Easy onboarding and authentication

Sonar supports authentication delegation - if you're logged into your GitLab account, you're all set to start improving the quality of your code to start improving the quality of your code!

automatic

Auto issue assignment

Native Git data support so issues are automatically assigned and tracked, streamlining the code review process,  streamlining the code analysis process.

magnifying glass

Continuous inspection

Configure your CI chain to automatically analyze merge requests and branches and publish the Quality Gate results in the build summary, making static code analysis a seamless part of your CI/CD pipeline.

A must-have for your team

Loved by developers, trusted by organizations.

7M+

Developers use Sonar

bxs check-circle

5,000+

coding rules available

bx analyse

750 billion

lines of code analyzed every day

BITBUCKET CODE REVIEW

Security vulnerability review in Bitbucket

Sonar workflow integration helps you review and prioritize vulnerabilities directly from your repository during your code reviews.

Learn moreLink Arrow
Code in Bitbucket has issues

See the Bitbucket CI/CD benefits for yourself!

Watch the video Atlassian Bitbucket Pull Request/Branch Decoration with SonarQube

End-to-end Bitbucket CI/CD benefits

With its tight coupling to Bitbucket, Sonar static code analyzes your projects and provides code health metrics at the right time and in the right place

Promote only clean builds

Non-disruptive code quality analysis overlays your workflow so your team only produces clean builds. Your project’s Quality Gate status is clearly decorated right in Bitbucket Pipelines along with code coverage and duplication metrics. Live updating keeps everyone on the same page.


Integrate with Bitbucket CI, Jenkins, CircleCI or any other CI tool.

See it in SonarQube ServerLink Arrow
main branch of code is passed

Less setup; more code analysis

With fresh code to review and analyze, the onboarding wizard simplifies your startup, guiding you in adding all your projects and setting up quality auto-detection of branches and Pull Requests.

1-click with SonarQube CloudLink Arrow
code has maintainability and reliability issues

Sonar’s Bitbucket CI/CD integration supports dozens of popular languages, development frameworks and IaC platforms

  • Java
  • Typescript Logo
  • Javascript Logo
  • Terraform Logo
  • Cloudformation Logo
  • Docker
  • C Sharp Logo
  • VB Logo
  • PHP Logo
  • Python Logo
  • C Logo
  • C++ Logo
  • Ruby Logo
  • Swift Logo
  • HTML5 Logo
  • Go Logo
  • Scala Logo
  • Flex Logo
  • T-SQL Logo
  • XML Logo
  • PL/SQL Logo
  • ABAP Logo
  • Apex Logo
  • COBOL Logo
  • PL/I Logo
  • VB 6 Logo
  • RPG Logo

Integrate Bitbucket with Sonar now!

BitBucket FAQs

How does SonarQube integrate with Bitbucket for quality code analysis?

SonarQube integrates directly with Bitbucket, enabling teams to automate quality code checks throughout the software development lifecycle. By connecting SonarQube with your Bitbucket repositories, every pull request and code push can be automatically analyzed for bugs, vulnerabilities, and code quality issues. This integration helps to ensure that developers focus on new code quality and address problems at the source.

Once configured, SonarQube provides inline feedback on Bitbucket Pull Requests, highlighting issues and offering actionable insights before code is merged. This proactive approach improves code maintainability and security, helping teams to build software that’s robust and easy to evolve over time. The integration supports both Bitbucket Cloud and Bitbucket Data Center, ensuring developers using different Bitbucket platforms benefit from automated quality assurance workflows.

What are the key benefits of using SonarQube with Bitbucket?

The integration brings a powerful suite of automated code quality checks directly into the Bitbucket code review process. By surfacing issues early and often, teams can maintain high standards and minimize technical debt as part of their new code quality strategy. Quality at the source becomes a reality, leading to improved developer productivity and reduced time spent on code maintenance.

Beyond just bug and vulnerability detection, SonarQube in Bitbucket supports code standardization and best practices alignment across the team. The visibility of issues right in the pull request makes collaboration seamless, ensuring all contributors understand quality expectations and can act immediately on feedback. This results in a more reliable, sustainable codebase and more efficient software delivery.

How do I set up SonarQube with Bitbucket?

Setting up the integration is straightforward: start by installing the SonarQube integration app from the Bitbucket Marketplace. Next, configure your Bitbucket repository to use your SonarQube instance by adding the necessary project keys and authentication tokens in your CI/CD pipeline settings. SonarQube provides step-by-step guides for both Bitbucket Cloud and Data Center environments.

After initial configuration, you can fine-tune your analysis settings to scan automatically on pull requests or on pushes to main/development branches. Regular scans help enforce new code quality and make it easy to spot and fix issues before they reach production. For advanced setups, you can configure custom quality gates and notification settings to fit your workflow.

Can SonarQube for Bitbucket check code quality on pull requests?

Yes, SonarQube for Bitbucket is designed to analyze code quality on every pull request. When a developer submits a PR, SonarQube runs automated analysis, providing immediate feedback on quality issues such as bugs, vulnerabilities, and code smells. This approach supports quality at the source, allowing teams to resolve issues before merging.

Reviewers can see inline comments from SonarQube with direct links to suggested fixes and explanations for identified problems. This visibility ensures that team members can collaborate to uphold strict quality standards, reinforce code best practices, and avoid regressions in code health. Pull request analysis is a core pillar of new code quality strategies.

What is the difference between SonarQube for IDE and SonarQube integration in Bitbucket?

SonarQube for IDE (formerly SonarLint) is an extension that runs quality checks and provides instant feedback while developers write code in their preferred IDE. It allows individuals to catch issues locally and improve new code quality in every commit. By contrast, SonarQube integrated in Bitbucket operates at the repository and CI/CD pipeline level, analyzing code as part of each push or PR.

Both tools complement each other. SonarQube for IDE helps prevent issues from ever leaving the developer’s machine, while SonarQube for Bitbucket ensures all contributions meet team-wide standards. Together, they create a comprehensive ecosystem focused on quality at the source and continuous improvement across the project.

Does SonarQube integration support quality gates in Bitbucket workflows?

SonarQube integration lets teams leverage quality gates within Bitbucket workflows. Quality gates are configurable sets of criteria—such as code coverage, absence of critical bugs, and security standards—that must be met before code can be merged. This mechanism enforces new code quality requirements, making sure that software released is stable and secure.

Automated enforcement through quality gates in Bitbucket means teams can block merges that fail to meet their standards. Reviewers don’t have to manually check for compliance; SonarQube reports make the status clear and actionable. Quality gates help organizations move from reactive fixing to proactive quality assurance in every feature branch and pull request.

How does SonarQube Cloud differ from SonarQube Server for Bitbucket users?

SonarQube Cloud (previously SonarCloud) is a cloud-based offering that provides SaaS analysis and management, with zero infrastructure overhead for users. It integrates seamlessly with Bitbucket Cloud, enabling instant setup, scalability, and updates—all managed by SonarQube. SonarQube Server requires installation and maintenance by your IT or DevOps team, and is popular with organizations that prioritize local control and customization.

Both versions offer deep integration with Bitbucket, providing automated code quality checks, security analysis, and quality gates. The choice between SonarQube Cloud and SonarQube Server depends on your organization’s infrastructure preferences, compliance needs, and resource availability.

Is there a free tier for SonarQube Bitbucket integration, and what are its limitations

SonarQube Community Build & SonarQube Cloud offers a free tier of features for Bitbucket integration, allowing small teams and open-source projects to leverage quality code analysis without upfront cost. The free tier supports basic analysis, standard rule sets, and integration with Bitbucket pipelines, providing essential quality checks and reporting.

Larger organizations, or those requiring enterprise-grade governance, extended language support, and advanced security features, may need to upgrade to commercial editions. These versions include features such as branch analysis, custom quality gates, and sophisticated reporting, as well as dedicated support. The Community Build is ideal for trial, learning, and lightweight projects.

What programming languages and frameworks does SonarQube analyze in Bitbucket projects?

SonarQube offers extensive coverage, scanning over 40 programming languages and many popular frameworks commonly used in Bitbucket projects. Languages supported include Java, C#, JavaScript, Python, TypeScript, C++, and more. The tool continuously updates language rules to reflect new standards, common vulnerabilities, and quality patterns.

Whether your project uses microservices, frontend frameworks, or legacy stacks, SonarQube helps teams stay ahead of quality and security issues. Automated analysis ensures consistent standards across all codebases, with configuration options to tailor checks for specific languages and workflows. This adaptability is crucial for Bitbucket teams working in diverse technology environments.

How does SonarQube help with managing technical debt in Bitbucket repositories?

SonarQube’s automated analysis identifies and quantifies technical debt in your Bitbucket repositories, offering actionable insights and prioritization guidance. Each code scan highlights areas requiring refactoring, documents the estimated effort to fix issues, and tracks progress over time. This transparency helps teams make informed decisions about when and how to address technical debt as part of their long-term code quality initiatives.

By embedding quality checks in every pull request and commit, SonarQube enables a focus on new code quality, reducing the accumulation of technical debt at the source. This ongoing process lowers future maintenance costs, accelerates feature delivery, and improves software reliability for users and customers.

Unsubscribe