I would suggest a slightly different measure: How long can the code be left to run on it's own without the intervention of a programmer, sys admin, or other technical person?
I've noticed that poor codebases tend to suck up more and more developer time, and may even trigger the formation of "maintenance teams".
Software is a piece of capital. Take the benefits to business of a piece of software per unit time minus the costs of maintenance, operations and development effort then compare that to other opportunities to find a net present value.
Lots of software I have worked on has probably been in "technical bankruptcy", but nobody sat down and figured that out (or it didn't matter because there was some persistent political reason for the system to exist and for it not to be able to be effectively designed and delivered).
I've noticed that poor codebases tend to suck up more and more developer time, and may even trigger the formation of "maintenance teams".