Code smell in the source code is any indication on the surface of the programming code that hints at a deeper problem. This can be as trivial as an oversized method. The most accurate indication of a code smell is the testability of the code. If the code can be tested in a very simple and straightforward test then that means the code is not tightly coupled. This also means that the code is doing only one task, which can be tested end to end.
"a code smell is a surface indication that usually corresponds to a deeper problem in the system" | ||
--Martin Fowler |
There are a few types of code smell that can be identified by looking at the code.
An expendable is something gratuitous and futile. Removal of such code will make the code cleaner, efficient, and comprehensible. It can be one of the following:
Comments: As programmers, we sometimes tend to do things in the most cryptic way possible and then write lines of comments around the code to explain what ingenious solution we...