Total Lines Deleted Metric
TBD
Definition
Total Lines Deleted measures the number of lines of code removed during the selected time range.
A “line deleted” is any line that existed previously and was removed in a commit that was later merged.
In AI Analytics views, this metric reflects lines removed or replaced that are associated with the selected AI dimension (e.g., Coding Assistance).

How the Metric Is Calculated
Total Lines Deleted is calculated as:
Sum of all lines removed across merged pull requests within the selected time range
This metric includes only removed lines.
It does not include:
- Newly inserted lines
- Modified lines that remain present
In AI Analytics views, only lines attributed to the selected AI category are included.

Normalization
The headline value is normalized to the selected time bucket.
For example:
- Daily view → Lines deleted per day
- Weekly view → Lines deleted per week
- Monthly view → Lines deleted per month
The headline value represents:
Total lines deleted ÷ Number of selected time buckets
This enables comparison across time ranges.

How the Metric Is Displayed in the Dashboard
1. Headline Value (e.g., 14.9k on average per week)
Represents the average number of lines removed per selected time bucket.
This is not a total count.
2. Time-Based Values in the Chart
Each point represents:
The total number of lines removed within that specific time bucket
The chart reflects actual per-bucket volume, not cumulative totals.

What This Metric Reflects
Total Lines Deleted reflects:
- Code removal
- Refactoring cleanup
- Dead code elimination
- Replacement of legacy logic
- AI-assisted code rewrites (when filtered)
It does not reflect:
- Net code growth (see Total Lines Added)
- Overall change magnitude (see Total Lines Accepted)
- Code quality improvements directly
- Refactor vs rework classification

Relationship to Other Metrics
Metric | Measures |
Total Lines Added | Newly inserted lines |
Total Lines Deleted | Removed lines |
Total Lines Accepted | Added + modified + deleted |
Code Changes | Overall change volume |
Total Lines Deleted isolates reduction or replacement.

AI Analytics Context
When filtered by AI dimension:
- Reflects lines removed or replaced with AI involvement.
- Attribution depends on configured AI detection logic.
- Partial AI assistance may still count toward attribution.

Data Sources
Derived from:
- Git diff metadata
- Pull request merge events
- Repository integration APIs
- AI attribution signals (if filtered)

Limitations
- Measures volume, not impact.
- Large file removals can inflate values.
- Does not distinguish between cleanup and feature rollback.
- Does not measure code quality.
- AI attribution depends on detection precision.

Stakeholder Use Cases
Engineering Managers
- Monitor cleanup vs growth trends.
- Compare AI-assisted deletions vs human deletions.
Team Leads
- Detect excessive rollback or churn.
- Track refactor activity impact.
Architecture / Platform Teams
- Monitor codebase surface area reduction.
Product Leadership
- Understand scale of replacement or removal during roadmap shifts.
How did we do?
Total Lines Added Metric