Measurements of Code Quality?
Hi HN community! A friend of mine recently inherited a large Javascript codebase that’s not in great shape. We were brainstorming ways to measure “progress” towards cleaning it up to help others understand what’s going on - some ideas include P90 file & function length, looking at import statements to determine the spaghetti-factor, and looking at the frequency of repeated chunks of code and general low effort code (poor variable names, n^2 loops, etc). We tried a few static analysis tools out there and didn't find the thousands of "errors" they detected very helpful.
I’m curious how you intuitively judge the goodness of code, and whether that could be measured. Let me know if you’d like to see this as an open-source tool too, though the last thing I would want is yet another way to “measure developer productivity”.