Code coverage

Measure code coverage metrics and identify untested code paths

Shipping code without knowing what's tested is shipping risk. DeepSource tracks coverage on every pull request, surfaces untested code paths as actionable issues, and gates merges when coverage drops below your thresholds.

How it works

DeepSource integrates with your existing test framework and CI pipeline to collect, analyze, and act on coverage data.

  1. You generate coverage reports in CI using your existing test runner (pytest, Jest, go test, JaCoCo, etc.)
  2. DeepSource CLI reports the artifact to DeepSource
  3. DeepSource analyzes line, branch, condition, and composite coverage across the entire repository

Most coverage tools stop here, giving you a percentage and a dashboard. DeepSource gives you something you can act on:

  • Composite coverage: a weighted metric combining line, branch, and condition coverage into a single number, so you're not juggling three separate thresholds
  • Actionable issues, not just dashboards: untested lines are raised as specific issues with file and line references, just like code quality issues
  • Diff coverage on every PR: tracks coverage of new and changed code specifically (NLCV, NBCV, NCCV, NCPCV), so new code doesn't erode your baseline
  • Quality gates: block PRs that don't meet coverage thresholds, enforced alongside your other code quality checks

Supported languages and formats

Coverage analysis supports a wide range of languages and report formats. See the Languages reference for the full list of supported languages and coverage formats.

Getting started

For a full setup walkthrough, including CI-specific examples, see Track code coverage. You can also explore coverage trends and drill into metrics from the Metrics dashboard.

On this page