Determining what is or is not a code Smell is always a subjective judgment, and will always vary according to the programming language, developer and development methodology.
There are tools that detect certain types of Smells code, such as:
Java: Checkstyle, PMD and Findbugs.
.Net: Resharper.
To Php.
Some common Code Smells:
Duplicate code: identical or very similar code exists in more than one location.
Long method: a very extensive method, function or process.
Extended class: a class that ended up getting very extensive (God Object).
Feature Envy (no translation): a class that overuses methods of another class.
Inappropriate intimacy: a class that has dependency on implementation details from another class.
Refused legacy: a class overriding (override) the generic class method so that the generic class contract is not fulfilled by the derived class.
Lazy class: class that does very little.
Artificial complexity: forced use of extremely complicated Patterns design, where a simple design would suffice.
Excessively long identifiers: in particular, the use of naming conventions to avoid ambiguities, which should be implicit in the software architecture.
I thought it was something related to technical debt, but I’m not sure.
– Math
@Math is there in the Wikipedia article, "Code Smells are an Important Reason for Technical Debt."
– Piovezan
@Piovezan is right, I did not read the page, but I knew it had something to do :P
– Math
@Math I had never heard of technical debt, I think there are so many factors that should be considered when it comes to seeing if a code can be refactored or not that make me more confused, I end up remembering an old phrase of the programmers "If this works,."
– Gabriel Rodrigues
Do you know the expression "where there is smoke there is fire"? The meaning of this is, good, not always smoke means fire, but it’s a good sign, so better stay alert... From the form table, in my understanding, "code Smell" has the sense to indicate things that are not "wrong" in the code, but that may indicate a deeper problem. Sometimes the programmer deviates from "good practice" for good reason. But most of the time, it does it out of ignorance, so it is good to be aware of the possible consequences (review the code), because it may not be broken now but has a good chance of breaking in the future.
– mgibsonbr
@mgibsonbr Very well spoken.
– Piovezan
In good English, code Smell is the famous "gambiarra".
– Kira