DevOps
Sonar tightly integrates with the most popular DevOps platforms, such as GitLab, Jenkins, and Azure DevOps, allowing you to collect code coverage data during your build phases.
An important part of what makes code high quality code is that it fulfills a desired outcome and is testable. Unit testing verifies if code meets that intended outcome and proves that it is testable. SonarQube acts as a central hub, collecting code test coverage and presenting it as clear pass/fail metrics in a quality gate that prevents substandard code from reaching production.
Thoroughly testing your code is key to maintaining its quality and reliability. It ensures that it behaves as expected under specific scenarios and produces the correct results based on given inputs. With clear code test coverage metrics, teams can prioritize gaps in code test coverage and determine where to focus effort in order to meet your code test coverage target.
Higher code test coverage means more of your code is being tested and has been proven to be testable. This leads to improved code maintainability because testable code proves modularity. Over time, consistent code test coverage targets create a feedback loop that guide better design decisions and more modular code.
In order to include code coverage results in your analysis, you must set up a third-party code test coverage tool and configure SonarQube Server to import the results produced by that tool. SonarQube integrates with multiple code test coverage tools.
Assess the overall health of your code by importing your code test coverage test results into SonarQube Server and Cloud in over 40 programming languages.
A well-tested codebase with high code test coverage gives developers confidence, minimizing the risk of introducing new code quality issues in production.
Displays code test coverage as a percentage of the amount of code including clear pass/fail metrics of your desired test coverage goals.
SonarQube clearly highlights untested lines of code so you can easily make decisions on where gaps in code test coverage exist.
Code test coverage metrics assist with measuring test effectiveness, improving code quality, reliability and maintainability.
Sonarqube guides developers to focus on building tests for new code to ensure new code meets your code test coverage standards. This improves productivity by narrowing developer focus on what matters most.
Seamlessly integrated where you work: in the IDE, in DevOps platforms, and in Slack so you don’t have to leave your tools to get the code health details you need.
SELF-MANAGED
Calculate and store code test coverage metrics (line, condition, new code) based on data generated by external, third-party tools both on-premise or in the cloud. Receive detailed reports that visualize test coverage percentages and identify areas with low test coverage. Use quality profiles to define minimum code test coverage thresholds.
SaaS
Calculate and store code test coverage metrics (line, condition, new code) based on data generated by external, third-party tools hosted in the cloud. Receive detailed reports that visualize test coverage percentages and identify areas with low test coverage. Use quality profiles to define minimum code test coverage thresholds.

"Sonar helps our development team confidently make both AI-assisted and human-developed code fit for production by reviewing and establishing rules of good programming practices"
Dario Flores, Technical Quality Specialist

Dario Flores, Technical Quality Specialist
"Sonar helps our development team confidently make both AI-assisted and human-developed code fit for production by reviewing and establishing rules of good programming practices"
Code test coverage represents the percentage of source code that is executed by testing, providing insight into which lines, branches, or conditions are verified by your test suite. With SonarQube, code test coverage metrics are displayed right in the quality gate at critical stages of development. Every line of code that is not covered by tests is highlighted, enabling development teams to better understand which parts of their codebase are covered by testing and which parts are lacking test coverage.
Tracking code test coverage helps teams focus on gaps in testing and identify risky, untested areas. SonarQube integrates code test coverage directly into its analysis workflow, enabling a continuous feedback loop that drives teams to maintain quality code and achieve reliable, maintainable software projects.
To measure code test coverage with SonarQube, you first need to generate test coverage reports using a supported testing tool in your development language (e.g., JaCoCo for Java, Istanbul for JavaScript, or Coverage.py for Python) and configure SonarQube to import these reports during analysis. The setup process typically involves specifying the path to the test coverage report in your project’s configuration file or build pipeline.
Once the reports are connected, SonarQube consolidates the test coverage information, displaying results prominently in the project dashboard. This empowers teams to monitor test coverage levels over time and manage improvements effectively, ensuring new and modified code remains well-tested through automated quality gates and code review processes.
SonarQube’s code test coverage stands out for its ability to integrate seamlessly with the entire developer ecosystem, consolidating test code test coverage results from all languages into SonarQube and combining them with other quality checks like bug detection, code smells, and security vulnerabilities. This unified view streamlines the remediation workflow, making quality code a central part of your development pipeline and helping teams prioritize the most impactful improvements.
Moreover, SonarQube’s dashboards and visualizations allow teams to track code test coverage results over time, providing actionable feedback directly within the development lifecycle for each branch and pull request. By focusing on new code quality and ensuring code is well-tested from the start, organizations enhance reliability, reduce technical debt, and build robust maintainable software products.
Yes, SonarQube supports code test coverage analysis for a broad range of programming languages, including Java, Python, JavaScript, TypeScript, C#, PHP, and more. Even though each language may have its own test coverage tools and reporting formats, SonarQube acts as an aggregator, presenting unified metrics and ensuring consistency across all projects, even polyglot ones.
This multi-language capability enables large organizations with multiple teams to standardize on code quality. By adopting SonarQube, teams can confidently govern and monitor test coverage and quality code across all of their repositories, making it easier to collaborate and enforce standards regardless of technology stack.
SonarQube Cloud offers scalable, hosted analysis and quality management for teams requiring advanced features, granular permissions, and effortless maintenance. It includes comprehensive code test coverage metrics, just like the Community Build, but adds benefits like enterprise integration, user management, and continuous updates—all managed in the cloud.
SonarQube Community Build provides open source access to core code test coverage analysis features. While ideal for small teams or personal projects, Community Build users handle maintenance and updates themselves. Both options enable detailed code test coverage metrics, but SonarQube Cloud is built for organizations seeking reliability, scalability, and advanced capabilities.
SonarQube for IDE allows developers to catch issues and review test coverage results directly within their favorite development environment, such as IntelliJ IDEA, Visual Studio Code, or Eclipse. SonarQube Cloud and IDE work together to deliver instant feedback, enabling developers to address gaps in test coverage and quality code standards as they write new features or refactor legacy code.
By embedding analysis in the IDE, teams can focus on code quality from the start and improve the quality of new code before changes reach shared repositories. The workflow minimizes context switching, empowers individual contributors, and accelerates delivery cycles with confidence in thoroughly tested and maintainable code.
A quality gate is a set of enforceable criteria in SonarQube that determines whether code changes are acceptable to progress through the CI/CD pipeline at critical steps like building, pull request creation, merging and release. Code test coverage is one of the important quality metrics in quality gates, requiring that new or changed code meets defined code test coverage thresholds to ensure robust testing practices.
Quality gates help enforce organizational code quality standards and reduce the risk of undetected bugs making it into production. By focusing on new code and integrating with continuous integration (CI) pipelines, SonarQube enables code quality at the source and empowers teams to deliver reliable software efficiently.
SonarQube helps organizations focus on new code quality by tracking test coverage on new or modified files, drawing attention to areas where test gaps could introduce risk. Its dashboards highlight weaknesses at the source, enabling teams to remediate issues before they grow into larger problems.
This “quality at the source” philosophy ensures that high standards are enforced continuously, preventing technical debt from accumulating. By automating test coverage tracking and integration with code review workflows, SonarQube helps organizations improve software reliability and development velocity.
SonarQube integrates with popular DevOps platforms and CI/CD pipelines, including GitHub Actions, Azure DevOps, Jenkins, GitLab CI, Bitbucket Pipelines, Circle CI, Amazon CodeCatalyst, CloudBees, and Travis CI. These integrations enable automatic analysis, triggering code test coverage checks with every commit, branch, or pull request including quality gates to prevent substandard code from progressing through the CI pipeline.
By linking test coverage results to the code review processes, SonarQube creates a seamless, team-oriented approach to managing code quality. Developers, reviewers, and release managers can effortlessly track quality and test coverage trends, streamline collaboration, and ensure that every code change meets organizational standards for reliability and maintainability.
SonarQube provides rich visualizations and historical tracking for code test coverage, enabling teams to monitor progress, identify trends, and plan improvements where they are most needed. Its dashboards display actionable data, empowering teams to address weak points and drive progress in code quality as projects evolve.
Through comprehensive reporting, organizations foster a culture of continuous improvement, making code quality a shared responsibility. SonarQube’s insights guide decision-making and resource allocation, ensuring that investments in testing and test coverage have lasting impact on software performance and reliability.