Static analysis tools like Sonar can do some of this already, definitely the complexity measures Austin mentioned. Some other things that come to mind are:
class size in lines of code
levels of indentation (i like to keep it under 2)
number of parameters to a function
number of methods on an interface
number of break/continue statements inside loops
abbreviations in names (variables, functions, and types)
everyone working on the same pieces of code should definitely have a common formatting that’s performed on every file. Variations from the standard format could be measured.
There’s the idea that you can follow a simple set of (arguably measurable by code) rules and you’ll end up with much more readable code. This topic always makes me think of this talk—following small rules can add up to big readability improvements.
Static analysis tools like Sonar can do some of this already, definitely the complexity measures Austin mentioned. Some other things that come to mind are:
everyone working on the same pieces of code should definitely have a common formatting that’s performed on every file. Variations from the standard format could be measured.
There’s the idea that you can follow a simple set of (arguably measurable by code) rules and you’ll end up with much more readable code. This topic always makes me think of this talk—following small rules can add up to big readability improvements.
I don't think that size (LOC or number of something) is readability metric. See my answer here dev.to/stereobooster/comment/m56f