sonar_get_technical_debt
Comprehensive technical debt analysis with time estimates, budget planning, ROI calculations, and prioritized action plan.
Description
Analyzes technical debt across bugs, vulnerabilities, and code smells. Provides actionable insights for sprint planning including time estimates, budget analysis, and ROI calculations.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
includeBudgetAnalysis | boolean | No | true | Include time budget planning |
Usage
Full Analysis
What's our technical debt situation?
Tool call:
{}
Without Budget
Show me technical debt without budget analysis
Tool call:
{
"includeBudgetAnalysis": false
}
Response Format
TECHNICAL DEBT ANALYSIS
━━━━━━━━━━━━━━━━━━━━━━━
📊 OVERVIEW:
Total Debt: 5d 2h (3,960 minutes)
Debt Ratio: 3.2%
Quality Score: B
📋 BREAKDOWN BY TYPE:
Bugs (12 issues):
Debt: 1d 4h
Priority: HIGH
────────────────────
BLOCKER: 2 (8h)
CRITICAL: 3 (6h)
MAJOR: 5 (8h)
MINOR: 2 (2h)
Vulnerabilities (5 issues):
Debt: 6h
Priority: CRITICAL
────────────────────
CRITICAL: 2 (4h)
MAJOR: 3 (2h)
Code Smells (156 issues):
Debt: 3d 0h
Priority: MEDIUM
────────────────────
MAJOR: 45 (18h)
MINOR: 89 (8h)
INFO: 22 (2h)
💰 BUDGET ANALYSIS:
For 1-day sprint (8h):
- Fix all BLOCKER bugs (2h)
- Fix all CRITICAL vulnerabilities (4h)
- Remaining: 2h for code smells
Impact: -23% total debt
For 3-day sprint (24h):
- Fix all bugs (12h)
- Fix all vulnerabilities (6h)
- Fix 15 major code smells (6h)
Impact: -58% total debt
For 1-week sprint (40h):
- Fix all bugs and vulnerabilities (18h)
- Fix 55 code smells (22h)
Impact: -85% total debt
📈 ROI ANALYSIS:
High-Impact Quick Wins:
1. Fix 2 BLOCKER bugs
Time: 2h | Impact: Security + Reliability
2. Fix 2 CRITICAL vulnerabilities
Time: 4h | Impact: Security Rating A → B
3. Remove 23 unused imports
Time: 30min | Impact: 15% fewer code smells
🎯 RECOMMENDATIONS:
Immediate Actions:
• Fix all blockers and critical vulnerabilities
• Estimated time: 8h
• Impact: Significant security improvement
Short-term (1 week):
• Address all bugs
• Fix major code smells in hot paths
• Target: Security Rating A
Long-term:
• Maintain debt ratio below 5%
• Regular cleanup sprints
• Prevent new debt via quality gates
Debt Calculation
SonarQube calculates debt based on:
| Issue Type | Typical Effort |
|---|---|
| Blocker bug | 4h |
| Critical bug | 2h |
| Major code smell | 30min |
| Minor code smell | 10min |
Examples
Example 1: Sprint Planning
Prompt:
Help me plan a debt reduction sprint
Tool Call:
{
"includeBudgetAnalysis": true
}
Example 2: Quick Overview
Prompt:
How much technical debt do we have?
Tool Call:
{
"includeBudgetAnalysis": false
}
Example 3: Executive Report
Prompt:
I need debt analysis for a management report
Tool Call:
{
"includeBudgetAnalysis": true
}
ROI Prioritization
Prioritize debt by:
| Factor | Weight |
|---|---|
| Security impact | Highest |
| Reliability impact | High |
| Maintainability | Medium |
| Fix time | Consider |
Best Practices
- Regular reviews - Check debt weekly
- Budget time - Allocate 10-20% of sprint to debt
- Prevent accumulation - Quality gates block new debt
- Track trends - Debt should decrease over time
Common Issues
"No debt data"
Cause: Project hasn't been scanned.
Solution: Run sonar_scan_project first.
"Debt seems too high/low"
Cause: Effort estimates may not match your team.
Solution: Use as relative measure, not absolute.
Related Tools
sonar_analyze_patterns- Group by fixabilitysonar_get_project_metrics- All metricssonar_generate_report- Full report