Tough to answer this question directly, but I can think of a few ways of getting at it - I'd probably want to see multiple metrics used in combination to create some kind of "score"
- Aging analysis of classes / methods (when was the last time this method was changed?)
- Bugs per feature area, or if you're looking for more technical analysis bugs per function point / class / method - I'd caution here that some people might be tempted to use this as a developer performance metric, so tread lightly
- Cyclomatic complexity or function point analysis
- Code coverage / unit test density
- Qualitative code coverage / "WTFness" measure - a mix of engineers familiar with the code and those who are not will yield great insight into things like readability, logical flow, etc - more subjective sure, but so is tech debt :)
hope that helps!