Good read. I would especially want to know more about the unpredictability of the red code/unhealthy code. The difference between healthy code and red code regarding implementation time is astonishing.
This is indeed something that the academic research paper (see https://arxiv.org/abs/2203.04374) identifies as Future Work. There could be a code familiarity component that explains the large risks and variations.
From the paper:
"Could it be that changes done by the main author are faster and more predictable than corresponding changes made by a minor contributor? We suspect that author experience could be a factor that impacts the predictability of changes to low quality code."
If that turns out to be the case, then it would highlight organizational dimensions of low quality code: key personnel dependencies and on-boarding challenges.
I'm not John, but I'm one of the authors of the research paper. Indeed, one goal with this work is to complement DORA’s delivery metrics with similar correlations between code quality and its business impact.
Hopefully, this work can help developers when communicating with the product/business side. The sad reality is that without quantifiable metrics, short term targets will win over the long-term maintainability of the codebase. Only a minority of companies actively manage technical debt.
This appears to be selling a static analysis tool that rates code on a 1 to 10 scale on a few axes where the assessment criteria are opaque. So on the face of it that's not something developers are going to like.
@john-shaffer if this is your tool can you provide a link to how the various metrics are computed?
edit: FAQ doesn't include the above. It does say the tool requires write access to GitHub repos it analyses.
I have no affiliation, but I tried the free trial of their tool and I found that the Code Health metrics made a lot of sense. The files that it pointed out are definitely overly complex and more difficult to change than they need to be. But it gave perfect scores to some files with complex jobs that are better-designed. I recommend just giving it a spin on a codebase that you are very familiar with.