Skip to main content

What is Bug Ratio

Bug Ratio is the percentage of closed pull requests that are bug fixes. It shows how much of your delivery goes to fixing issues instead of building features. In the Cockpit, it’s the Bug Ratio card on the Productivity tab. It is not DORA’s change failure rate: it counts bug-fix PRs, not failed deployments.

How We Calculate It

A background job asks an AI model to classify each pull request from its title alone as Bug Fix, Feature, Refactor or Test. The PR description, labels and diff are not used, and there is nothing to configure.
The range is the date range selected at the top of the Cockpit, and a closed PR is merged or closed without merging. A PR that hasn’t been classified yet counts in the total but not as a bug fix. For example, if 3 out of 15 PRs are classified as bug fixes, your Bug Ratio is 20%. When the ratio is 0% in both the selected range and the previous period, the card shows Once we have enough data, your metrics will appear here. instead of 0%.

Reading the card

The card shows the percentage, a level badge, and the value for the previous period of the same length with the percentage change (lower is better). The footer reads “Last 2 weeks was …” whatever range is selected; the number is for the previous period. Hover the badge to see the levels:

Why PR Titles Matter

Because only the title is read, a descriptive title gives a more accurate ratio.

How to Improve

  • Test more at the unit, integration and end-to-end levels
  • Use linters and static analyzers before production
  • Break large features into smaller, testable pieces
  • Use feature flags for safer deployments
  • Run post-incident reviews to prevent recurrence