Developers only see current cyclomatic complexity. There's no visibility into how complexity evolves across commits, leading to gradual debt accumulation.
Objective
Track function-level complexity trends over Git history and warn when growth exceeds configurable thresholds.
Scope & Implementation Details
1. Complexity Calculation
- Parse file AST using
@typescript-eslint/typescript-estree or tree-sitter
- Compute Cyclomatic Complexity (CC) per function/method
- Store:
{ name, range, cc, filePath }
2. Git Comparison
- Fetch historical snapshots:
git log --follow -p -- <file>
- Extract function CC at each commit
- Compare current CC vs 5/10/30-day averages
3. Warning System
- Inline decoration on function name if growth > threshold (default: 50%)
- Status bar notification:
"⚠️ Function complexity grew +85% in 14 days"
- Hover tooltip shows trend chart (text-based or simple markdown table)
4. Configuration
complexityTracker.thresholdPercent (default: 50)
complexityTracker.lookbackDays (default: 14)
complexityTracker.ignoredFunctions (string[])
Acceptance Criteria
Technical Notes
- Use
git show <commit>:<file> to parse historical ASTs
- Cache AST parses to avoid re-running on unchanged files
- Limit history depth to last 20 commits to prevent slowdowns
- Handle syntax errors gracefully (skip malformed files)
Developers only see current cyclomatic complexity. There's no visibility into how complexity evolves across commits, leading to gradual debt accumulation.
Objective
Track function-level complexity trends over Git history and warn when growth exceeds configurable thresholds.
Scope & Implementation Details
1. Complexity Calculation
@typescript-eslint/typescript-estreeortree-sitter{ name, range, cc, filePath }2. Git Comparison
git log --follow -p -- <file>3. Warning System
"⚠️ Function complexity grew +85% in 14 days"4. Configuration
complexityTracker.thresholdPercent(default: 50)complexityTracker.lookbackDays(default: 14)complexityTracker.ignoredFunctions(string[])Acceptance Criteria
Technical Notes
git show <commit>:<file>to parse historical ASTs