See what's new on Keypup!  📢
Learn more
Code Refactoring Ratio
Maintain a tidy and clean code base by ensuring a reasonable refactoring ratio is performed by your engineering team.
Manage Your Tech Debt
with
Code Refactoring Ratio
Maintain a tidy and clean code base by ensuring a reasonable refactoring ratio is performed by your engineering team.



Understand the Refactoring Ratio Metric Template
The refactoring ratio metric template calculates the ratio of added and deleted lines among all merged pull requests over the past 12 months.
How to Use the Refactoring Ratio Metric Template
Technical teams at elite performing companies continuously refactor code. Therefore, this KPI should be used to detect:Â
- Excessively low ratio (< 20%), meaning your teams may have too many features or bug fixes to perform, leaving less time for day-to-day workload for refactoring. It is possible that your teams’ lack the seniority to raise awareness and educate engineers about code refactoring.
- There is a risk of accidentally removing valid features from your code if the ratio is excessively high (> 200%). Efforts should be increased to conduct regression tests.‍
- An unusual average ratio (+/- 50% of usual average) may indicate recent changes in your teams’ habits. For example, a rise in the ratio as a project draws to a close (e.g., cleanup activities) or a drop in the ratio due to pressure to ship features too quickly.