There's no reason to measure it, just don't let people merge difficult-to-understand code into the codebase. The best comment you can leave on a PR is always, "I don't understand this, please rewrite it." People hate hearing it, they'd much prefer it if you'd show them some new trick or something, but that's not nearly as valuable to the company or whatever.
It’s reasonable to assume there are times that complex problems require complex solutions. Saying “this code feels like it could be simpler, have you tried x?” would accomplish the same goal without the aggressive and lazy tone imo.
If you sent in an article to a magazine as a freelancer and the editors didn't understand what you were trying to say, then you probably wouldn't even get a response. And if you did it repeatedly they'd probably block your email address.
Obviously no one is going to immediately intuitively understand a 1,000 character regex. But I'm sure we've all seen people who have treated basic CRUD apps like obfuscated C competitions.
The problem is that it ends up saying more about the maintainer than about understandability.
Is object oriented program hard to understand?
Is C with manual memory management hard to understand?
Are genetics hard to understand?
Is functional style programming hard to understand?
Is SIMD hard to understand?
Is code that uses linear algebra hard to understand?
Different people, and even the same person over time, will have different answers to these questions.
> In 1976, Thomas McCabe Snr proposed a metric for calculating code complexity, called Cyclomatic Complexity.
https://blog.codacy.com/an-in-depth-explanation-of-code-comp...
There is also likely some simple metrics you could get by looking at names of things alone.
Common substrings, length, and diversity of names are probably decent indicators.
Even just proposing standard language for a survey question, like Net Promoter Score, would help.
As of today, it seems inappropriate to call understandability a "metric." What's a metric that can't be measured?