Here's a link to some docs about how code health is calculated: https://codescene.io/docs/guides/technical/code-health.html
In simple terms we try to measure cognitive complexity of source code.
A more in-depth description of one of the factors: https://codescene.com/blog/bumpy-road-code-complexity-in-con...