Code lines per file, methods per class, cyclomatic complexity and so on. Developers resist and workaround most if not all of them! There is a good Joel article on it (no time to find it now).
What code metric(s) you recommend for use to automatically identify "crappy code"?
What can convince most (you can't convince all of us to some crappy metric! :O) ) of developers that this code is "crap".
Only metrics that can be automatically measured counts!
Published source code metrics can be broadly divided into five categories, based on what they measure: size, complexity, coupling, cohesion, and inheritance. We provide a brief description of each category, along with some of the most influential publications on each of these categories of metrics.
Using lines of code as a code quality metric by itself is not an efficient way to evaluate developer performance, since it also counts commented code or rewrites. It also tends to encourage some bad behavior, at a team level.
Not an automated solution, but I find WTF's per minute useful.
(source: osnews.com)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With