METRICS AND ANALYSIS SOLUTION

Code coverage

Assess the quality of your code with test coverage and test execution reports by telling you what percentage of your code is covered by your test cases. SonarQube Server acts as a central hub that integrates with popular code coverage tools. It consolidates coverage reports with static code analysis results, giving you clear pass/fail metrics to ensure your code meets quality standards efficiently.

Import code coverage reports

In order to include code coverage results in your analysis, you must set up a third-party coverage tool and configure SonarQube Server to import the results produced by that tool. Sonar integrates with multiple code coverage tools.  

an image of code coverage percentage covered by tests

Improve code quality

Thoroughly testing your code is key to maintaining its quality and reliability. It ensures that any functional issues such as bugs and vulnerabilities, are quickly identified, allowing you to make updates with confidence. 

Image shows the quality score of a production environment

Improve code maintainability

Higher code coverage means more of your code is being tested, helping identify bugs earlier in the development process. This leads to improved code maintainability and reliability.

image shows quality scores of an application

Code coverage support for languages

Sonar supports code coverage for the following languages:

CODE COVERAGE TOOL

Code coverage solution benefits

Assess the overall health of your code by importing your code coverage test results into the SonarQube Server and SonarQube Cloud solutions in over 30 programming languages.

Reduce risks and issues

A well-tested codebase with high coverage gives developers confidence, minimizing the risk of introducing new bugs in production.

Early bug detection

Enables early identification of bugs during the development process, reducing the likelihood of issues in production.

Clear metrics

Provides clear pass/fail metrics for code coverage, allowing teams to assess their testing effectiveness easily.

Actionable insights

Sonar solutions offer granular code coverage reports that pinpoint untested sections of your code and recommend improvements

Continuous improvement

Code coverage metrics assist with measuring test effectiveness allowing improved code quality and reliability. 

Improve developer productivity

Developers can prioritize tests when they are most needed by focusing on areas with low code coverage, saving time from manual code reviews. 

Increased developer skills

By working with code coverage reports, developers are able to view and write more complete tests, leading to better coding practices. 

Workflow integration

Seamlessly integrate with popular build pipelines (Gitlab, Jenkins) enabling automatic analysis and reporting of code coverage in the software development workflow. 

Unlimited users across teams

You can have as many users as you need for any license. Perfect for enterprise teams of any size that need to analyze code.

Unlimited projects

You can have as many projects as you need to analyze with no set limit. This is ideal for organizations that need to analyze code from multiple projects or teams within an organization.

Unlimited scans in your org

This means that you can scan your code as often as you need to without any limit cap. This is essential for organizations that need to monitor the quality of their code continuously.

Integrated code coverage in your CI/CD

Sonar succeeds at supporting code coverage within your DevOps, CI/CD, and IDE workflows.

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.  

Essential DevOps transformation tools
The best way to do code coverage

Release secure, reliable and maintainable software

SELF-MANAGED

SonarQube Server: self-managed solution

Calculate and store code coverage metrics (line, condition, new code) based on data generated by external, third-party tools on-premise. Receive detailed reports that visualize coverage percentages and identify areas with low coverage. Use quality gates to define minimum code coverage thresholds.

Download SonarQube Server now
passing branch is merged
image of a code issue being checked and fixed for security
  • 法律文件
  • 信任中心
  • Follow SonarSource on Twitter
  • Follow SonarSource on Linkedin

© 2008-2024 SonarSource SA。保留所有权利。SONAR、SONARSOURCE、SONARQUBE、 和 CLEAN AS YOU CODE 是 SonarSource SA 的商标。