Guided Workflow for Paying Down Technical Debt
A 6-Step Guide for finding the files and functions that once refactored will deliver the greatest return on investment, taking targeted action and proactively mitigating active risks
Drawing inspiration from our peer-reviewed Code Red whitepaper, we know improving your code health not only makes your code more accessible but also turbocharges your development process. With improved Code Health, you can deliver sustainable features faster and significantly cut down on the time spent reacting to bugs and defects.

Important: Stabilise the Codebase First
High-impact refactoring is essential for reducing technical debt, but make sure you have put a bare minimum quality bar in place to ensure no new technical debt is introduced. Instructions for doing this can be found here.

1. Obtain Situational Awareness
To visualise where you are today in terms of technical debt, check out this 1-min walkthrough or follow the steps below.
Open your CodeScene project and select “Code” → “Technical Debt”:

Technical Debt Friction
Click Technical Debt Friction:

This view provides a holistic overview of technical debt friction across the code base. Technical Debt Friction is a compound analysis built on top of Code Health and Hotspots, highlighting the files where productivity is most impacted. Files labeled red indicate the highest friction.
Hover over a friction label to see how many files are in each category. Just click a label to view only the files where technical debt slows you down the most.
Prioritise Efforts with Smart Refactoring Targets
Click Refactoring Targets to see your high-impact refactoring opportunities.

The Refactoring Targets view highlights both high-impact refactoring opportunities in the code base (recommended) and opportunities within a specific component (local).
The red files in the system map are your recommended refactoring targets. When codebases are large, CodeScene groups related files into components, letting you refactor large codebases more effectively. These files are marked in yellow.
Line coverage - is it safe to refactor?
To check if it is safe to refactor a file, first check its line coverage. In case the file has poor coverage, improve that before you start refactoring. Line Coverage is only visible if you've enabled Code Coverage (instructions here).
2. Plan Remediation Efforts
Now we have identified a refactoring opportunity, open up the Virtual Code Review to view the specific problems and get refactoring recommendations down to the function level.

Virtual Code Review
The Virtual Code Review provides full insights into the file, including its code health trend over time, functions with violations, and key contributors who could be best placed to take on the refactoring task.

Set a Refactoring Goal
While here, make sure to set a Planned Refactoring Goal so CodeScene is business context-aware and expecting the code health improve.

X-Ray: Function Prioritisation
When dealing with particularly large files, it may not be feasible to refactor every single violation. In such cases, consider running an X-ray analysis to identify the most costly functions and violations that require immediate attention.
Focusing on these high-impact functions ensures the greatest return on investment (ROI) in enhancing code health and the speed at which safe changes can be implemented going forward.

3. Execute Remediation
Now it’s show time, let’s make an immediate impact.
Success Insight: With CodeScene’s MCP Server combined with CodeScene ACE, refactorings which would take days can be reduced to minutes. Check out Reducing Technical Debt: CodeScene Rollout Steps that Work for all the details.
Allocate Resources
Assign the necessary resources and personnel to work on the remediation tasks. As a reminder, key contributors who could be best placed to take on the refactoring task can be found in the Virtual Code Review.
Refactor Safely with Immediate Feedback
Make sure your developers have followed this 3-Step Developer Onboarding guide to install CodeScene’s IDE extension and receive real-time feedback on the changes they are making as part of this work.
4. Monitor Progress
Regularly monitor the progress of the remediation efforts. Use CodeScene to track improvements and ensure that the technical debt is being effectively reduced by focusing on the trends in the dashboard and PR statistics.
Pro tip: Filter the dashboard by Goals to isolate the files you have committed to refactoring to see their overall trends

5. Review and Adjust
After completing the remediation tasks, review the outcomes to ensure that the technical debt has been effectively addressed.
Adjust Strategies
Based on the review, adjust your strategies for managing technical debt in future projects. Learn from the process to improve efficiency and effectiveness.
6. Continuous Monitoring
Continuously review the CodeScene dashboard to monitor the codebase to ensure code health is trending upwards or stable at a minimum.
Proactive Management
Be proactive in managing technical debt by addressing issues as they arise, acting on CodeScenes Active Risks by setting a “Supervise” goal to ensure technical debt does not accumulate.
View The Active Risks

Acknowledge The Active Risks

Success Insight: By following this structured workflow, you can effectively manage technical debt, ensuring a healthier and more maintainable codebase. Teams leveraging CodeScene’s MCP Server & CodeScene ACE see measurable code health improvements within minutes.