GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • GitHub Docs
  • Security and code quality
  • Reference
  • Code quality
  • GitHub security features
  • Secure repository quickstart
  • Secret leakage risks
  • Secret scanning
  • Public monitoring
  • Push protection
  • Secret security with GitHub
  • Secret scanning alerts
  • Custom patterns
  • Validity checks

This view

  • Original page
  • New address

GeezerVison is showing docs.github.com — Code coverage reference - GitHub Docs

Code coverage reference

Code Quality shows what percentage of the lines of your code your tests actually exercise, so you can find untested code before you merge.

In this article

Code coverage measures what percentage of the lines in your source code are executed when your test suite runs. Code Quality displays a line coverage percentage on pull requests after you upload a Cobertura XML coverage report.

Note

Code Quality reports line coverage only. Coverage tools often also report function, branch, or statement coverage. Code Quality does not currently use these metrics, even if your Cobertura XML report includes them, and they are not shown on pull requests or evaluated by coverage threshold rules.

How line coverage is calculated

The line coverage percentage represents the number of lines covered by tests divided by the total number of lines, expressed as a percentage. Code Quality stores the latest upload for each branch (including the default branch) and compares the pull request branch line coverage to the default branch line coverage.

For example, if your default branch has 44% line coverage and your pull request branch has 65% line coverage, the pull request gained 21 percentage points of line coverage.

Per-file delta

The per-file breakdown on pull requests shows how line coverage changed for each modified file. A positive delta means the file gained line coverage on the pull request branch compared to the default branch.

To set up code coverage for your repository, see Setting up code coverage for your repository.

Further reading

  • Metrics and scores reference
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.