I think the problem is that "code" straddles this very thin line between technology and operations. The value of technology is that you can solve a problem and perform it more effectively essentially indefinitely. Operations are much more fluid; the most effective way to run operations changes constantly and evolves over time. I think a lot of our time is wasted trying to capture operational logic that is unlikely to persist over long periods of time, and that's where some sort of code decay mechanism would he useful. But the flip side is that occasionally your code will encapsulate something more technological, a solution that addresses a core function of your business or whatever other problem space, and then you have code that you absolutely 100% do not want to decay. I'm not sure there's any clear mechanism to distinguish between those two things. Your idea of scanning code that runs in production might be a good place to start, but plenty of pseudo-dead code (logic that ought to be decayed but manages to run anyway) will probably continue to accrue.