Think there would be another metric that would be better?
E.g. a readability score for the code, one that could be composed of analyzing the cyclomatic complexity ( https://en.wikipedia.org/wiki/Cyclomatic_complexity ) and other factors that affect how easy/hard it is to read and understand it?
Or would most such attempts be deemed to fail because of how abstract code is and how hard to evaluate automatically it can be?
Re:Code Budgets
by bobthepanda on Saturday January 16, 2021 @02:40PM
(#25804812)
Lots of reasonable metrics become bad once you make them a target.
What we want could be a complexity metric corresponding to a set of lines.
I'd say that's something that could be ML-learnable with the right dataset.
Given an answer from stackoverflow, ask an average developer to identify what was the question from a set of say 5. The average time taken to provide a right answer would be the complexity score.
You could use a transformer trained on code, and make it transfer-learn a function approximating that score.
I'd rather have 20 lines of clear simple code then, 5 lines of dense complicated code.
Budgets will just make people write dense code.