Determining what a code smell is or is not always a subjective judgment, and will always vary according to the programming language, the developer, and the development methodology.
There are tools that detect certain types of code smells, such as:
Java: Checkstyle, PMD and FindBugs.
. Net: ReSharper.
For 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 procedure.
Extended class : a class that ended up getting very extensive (God Object).
Feature envy : A class that overrides methods of another class.
Inappropriate Intimacy : A class that has dependency on the implementation details of another class.
Legacy declined : A class that overrides the generic class method so that the generic class contract is not met by the derived class. >
Lazy class : class that does very little.
Artificial Complexity : Forced use of extremely complicated design patterns, 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.