views:

82

answers:

2

Possible Duplicate:
What are Code Smells? What is the best way to correct them?

We've all run across (as well as produced) "code smells". There are many kinds as documented here.

What I'm interested in is what's the funk responsible for the funkiest code. It is difficult when writing code to maintain the perspective needed to analyze your own mistakes, but while reading code, especially someone else's, they jump out at you. Some, one catches more whiffs of while refactoring and debugging than others.

So, when you are deep in the code and something tickles your nose, what is it most likely to be?

edit: Please note the language you are using when you answer. Hopefully we might learn which code smells are endemic to which languages and/or design philosophies. Don't worry about explaining fixes as there are plenty of resources for that already.

+1  A: 

Error density clusters - i.e. they follow a pareto rule (as in "80% of errors are found in 20% of the routines even when compensating for differences in size").

So the most simple code smell is finding a bug: where there's one, there are probably more.

"Code Complete" cites that implementation errors are most common for small projects, but usually become about even with alnalysis and design errors for large ones. Also, density of errors increases with amount of code.

(not as anecdoctical as you are probably looking for, but relevant nonetheless)

peterchen
+1  A: 

Looooooong Methods. I can 'prove' that for one project by our toxicity metrics, but I have the strong feeling, it is an extremely common code smell.

Jens Schauder