For me the single most important metric that identifies bad code is cyclomatic complexity. Almost all methods in my projects are below CC 10 and bugs are invariably found in legacy methods with CC over 30.
High CC usually indicates:
- code written in haste (ie. there was no time to find an elegant solution and not because the problem required a complex solution)
- untested code (no one writes tests for such beasts)
- code that was patched and fixed numerous times (ie. riddled with ifs and todo comments)
- a prime target for refactoring