Status Badges

Status badges let you display your project’s code coverage and maintainability metrics directly in your repository README. These badges update automatically as your metrics change, giving visitors an at-a-glance view of your code quality.

Available Badge Types

Qlty provides two types of status badges:

Code Coverage Badge

Displays your project’s code coverage percentage (0-100%).

Coverage Badge Example

Maintainability Badge

Displays your project’s maintainability rating as a letter grade (A, B, C, D, or F).

Maintainability Badge Example

Getting Your Badge Code

The easiest way to get your badge embed code is through the Qlty UI:

  1. Go to your project on qlty.sh
  2. Navigate to Settings > Badges
  3. Select the badge type (Maintainability or Code Coverage)
  4. Choose the format (SVG or PNG)
  5. Select the embed format (Markdown, HTML, or RDOC)
  6. Click Copy to copy the code to your clipboard
  7. Paste the code into your README

Badge URL Format

Badges are available at these URLs:

By Project ID

https://qlty.sh/badges/{projectId}/coverage.svg
https://qlty.sh/badges/{projectId}/maintainability.svg

By Workspace and Project

https://qlty.sh/gh/{workspace}/projects/{project}/coverage.svg
https://qlty.sh/gh/{workspace}/projects/{project}/maintainability.svg

Both SVG (.svg) and PNG (.png) formats are supported.

Embedding Examples

Markdown

1[![Maintainability](https://qlty.sh/badges/{projectId}/maintainability.svg)](https://qlty.sh/gh/{workspace}/projects/{project})
2[![Code Coverage](https://qlty.sh/badges/{projectId}/coverage.svg)](https://qlty.sh/gh/{workspace}/projects/{project})

HTML

1<a href="https://qlty.sh/gh/{workspace}/projects/{project}">
2 <img src="https://qlty.sh/badges/{projectId}/maintainability.svg" alt="Maintainability" />
3</a>
4<a href="https://qlty.sh/gh/{workspace}/projects/{project}">
5 <img src="https://qlty.sh/badges/{projectId}/coverage.svg" alt="Code Coverage" />
6</a>

RDOC

{<img src="https://qlty.sh/badges/{projectId}/maintainability.svg" alt="Maintainability" />}[https://qlty.sh/gh/{workspace}/projects/{project}]
{<img src="https://qlty.sh/badges/{projectId}/coverage.svg" alt="Code Coverage" />}[https://qlty.sh/gh/{workspace}/projects/{project}]

Migrating from CodeClimate Badges

If you’re migrating from CodeClimate, replacing your badges is straightforward:

Step 1: Set Up Your Project on Qlty

Before you can use Qlty badges, ensure your project is configured:

  1. Add your project to qlty.sh
  2. For coverage badges, set up coverage reporting so Qlty receives your coverage data

Step 2: Get Your New Badge Code

  1. Go to your project’s Settings > Badges page
  2. Copy the badge code for each badge type you need

Step 3: Replace the Badges in Your README

Find your existing CodeClimate badges, which typically look like:

1[![Maintainability](https://api.codeclimate.com/v1/badges/{repo_id}/maintainability)](https://codeclimate.com/github/{org}/{repo}/maintainability)
2[![Test Coverage](https://api.codeclimate.com/v1/badges/{repo_id}/test_coverage)](https://codeclimate.com/github/{org}/{repo}/test_coverage)

Replace them with the Qlty badge code you copied:

1[![Maintainability](https://qlty.sh/badges/{projectId}/maintainability.svg)](https://qlty.sh/gh/{workspace}/projects/{project})
2[![Code Coverage](https://qlty.sh/badges/{projectId}/coverage.svg)](https://qlty.sh/gh/{workspace}/projects/{project})

Step 4: Commit and Push

Commit your README changes and push to your repository. Your new Qlty badges will now display your current metrics.

Troubleshooting

Badge Shows “Unknown”

If your badge displays “unknown” instead of a value:

  • For coverage badges: Ensure coverage data is being uploaded to Qlty. Check your CI pipeline and verify reports appear in Project Settings > Code Coverage.
  • For maintainability badges: Ensure your project has been analyzed by Qlty at least once.

Badge Not Updating

Badges are cached for up to 10 minutes. If you’ve just uploaded new coverage data, wait a few minutes and refresh.

Badge Not Loading

  • Verify your project ID is correct
  • Check that the badge URL uses https:// (not http://)
  • For private projects, badges are only accessible to authenticated project members

See Also