if it works
One measure of technical debt is unittest coverage and closeness to full ci cd.
However bad code is, if it works its ok until you need to change it. If it has full unittests and can be trivialy deployed. It can be changed. Therefor its debt can be paid off.
Just a metric. But test coverage + cd readiness is imho a good one.