I read an article on LinkedIn titled "What code quality metrics should you track to improve your programming?"
When management attempts to qualify the quality of their product and development processes, they often look for existing metrics to inform their decisions.
Unfortunately...
Most automated code quality metrics should not be utilized by management. The number of "issues" discovered, or the complexity of a function, are metrics intended for developers themselves, to help steer their work.
In many instances, these metrics rely on false positives. Unless your team consistently reviews issues flagged by the automated tool, a significant portion of the identified issues will be false positives. Likewise, the tool will probably overlook more substantial concerns, such as excessively complex architecture.
The metrics that matters the most are:
How long it takes for a new programmer on the team to understand what the code does?
How happy are the developers working on the code base?
By focusing on reducing the amount of time it takes to onboard a new developer, you are indirectly making the code easier to understand. Code that is easier to understand inevitably leads to fewer defects.
Focusing on making your developers happy leads to greater productivity and less turnover.
Finally, if you really want to focus on producing quality, look at the customer/user reviews.