> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weaveos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bug ratio

> The proportion of code output spent on fixing bugs

## How it works

Bug ratio measures what percentage of your team's code output is spent on fixing bugs versus building features or doing other maintenance work.

To calculate it, Weave will:

1. Measure the total [code output](/metrics/code-output) of merged PRs for the time period, excluding ignored PRs
2. Identify which PRs are categorized as "bug" fixes using Weave's [PR type categorization](/analysis/type-categorization)
3. Measure the code output from those bug-fix PRs
4. Calculate the ratio: bug output / total output

### Bug ratio is weighted by effort, not PR count

Because bug ratio divides code output, each PR counts in proportion to its estimated effort. A large feature PR moves the ratio more than a small bug fix. That means bug ratio usually differs from the share of PRs that are bugs: if many of your bug fixes are small, 30% of merged PRs can be bugs while bug ratio is only 20%.

To see the share of PRs by count instead, look at PRs merged grouped by PR type.

## What is a bug PR?

A PR is categorized as a "bug" if it fixes something that is broken or not working as intended. This includes:

* Fixing customer-reported issues
* Addressing security vulnerabilities
* Correcting calculation errors
* Fixing UI elements that aren't displaying correctly
* Mitigating crashes or failing requests

Weave uses an AI agent to automatically categorize PRs, but you can manually override the categorization if needed. See [PR type categorization](/analysis/type-categorization) for more details.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.