Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What code metric(s) convince you that provided code is "crappy"? [closed]

Tags:

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!

like image 425
Dandikas Avatar asked Oct 09 '08 13:10

Dandikas


People also ask

What are the metrics of coding?

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.

Why lines of code is a bad metric?

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.


1 Answers

Not an automated solution, but I find WTF's per minute useful.

WTF's Per Minute
(source: osnews.com)

like image 154
Tom Ritter Avatar answered Sep 23 '22 21:09

Tom Ritter