New Code Metric
New Code measures the percentage of added lines relative to total code changes in merged pull requests across the selected time range.
Definition
New Code measures the percentage of code changes in merged Pull Requests (PRs) that represent newly added lines of code.
It reflects the proportion of development effort focused on adding new functionality rather than modifying existing code.
Only merged PRs are included in this metric.

How the Metric Is Calculated
New Code is calculated as: (Lines added ÷ Total lines changed) × 100
Where:
- Lines added = newly introduced lines of code
- Total lines changed = lines added + lines modified + lines deleted
The headline value represents: Total lines added ÷ Total lines changed across all merged PRs in the selected time range
This is a weighted percentage, calculated across the entire selected time range — not an average of daily values.

How the Metric Is Displayed in the Dashboard
The metric card displays two types of values:
1. Headline Value (e.g., 88.23%)
The large percentage at the top represents the aggregated New Code percentage across the selected time range.
It reflects the proportion of added code relative to total code changes for all merged PRs during that period.
2. Time-Based Values in the Chart
The line chart shows New Code aggregated per time bucket (for example, daily).
Each point represents: Total lines added ÷ Total lines changed within that specific time bucket
Clicking a point displays:
- The New Code percentage for that date
- The total number of code changes analyzed
Daily values are calculated independently per bucket and do not average to produce the headline value.

Why This Metric Is Useful
New Code provides visibility into:
- Feature development activity
- Innovation focus
- Balance between building new functionality and maintaining existing code
Higher New Code percentages typically indicate:
- Feature-driven development cycles
- Active product expansion
Lower New Code percentages may indicate:
- Refactoring initiatives
- Maintenance cycles
- Stabilization phases

How to Interpret New Code
New Code should be interpreted alongside:
- Refactor
- Rework
- PR Size
- Cycle Time
New Code should not be evaluated in isolation.
For feature-focused teams, New Code often constitutes 60–80% of PR changes.
However:
- Very high percentages may indicate insufficient maintenance.
- Very low percentages may indicate excessive technical debt management or limited feature delivery.
Context matters — team maturity, product lifecycle stage, and roadmap phase all influence this metric.

Tunable Configurations
New Code may be influenced by repository-level configuration:
- Thresholds for excluding trivial changes
- Inclusion and exclusion file filters
- Repository scope settings
Proper configuration ensures accurate representation of engineering effort.

Data Sources
Derived from:
- Repository diff data
- Merged Pull Request records
- File-level inclusion and exclusion rules

Limitations
- May overestimate impact if trivial lines are added.
- Large formatting changes can distort results.
- Does not measure complexity or architectural significance.
- Small datasets may produce volatile percentages.
New Code reflects volume, not impact.

Stakeholder Use Cases
Engineering Managers
- Monitor balance between innovation and maintenance.
- Detect overemphasis on feature delivery at the expense of stability.
Team Leads
- Align development activity with roadmap priorities.
- Identify shifts between feature and maintenance cycles.
Developers
- Understand contribution distribution.
- Track time spent on feature development.
Product Leadership
- Monitor delivery focus relative to roadmap expectations.
How did we do?
Merge Frequency Metric
PR Maturity Metric