A smell of code has to do with being a superficial indicator which in most cases has corresponded to a much bigger and deeper problem in the system. This term was first coined by Kent Beck. This character became famous even after the appearance he had with Martin Fowler’s book. Code winds are very subjective winds and which differ only on the basis of language, developers but also methodology that have other factors.
What are the some frequently seen smells?
Bloaters: In its entirety this includes code, but also classes and methods. This smell has become great over time, making the accumulation of functionality but also the creep of features it has.
For example: it is about long methods, for classes of gods but also for long lists of parameters.
Dispensable: This smell refers to code that is otherwise known as dead code, which can not be called or executed. These are unnecessary blocks of code, as these codes do not offer benefits, but make it possible to increase technical debt.
Psrsh: It is a duplicate code, it deals with the refactoring of objects, as well as makes the generalization premature.
Connections: This smell means the moment when a code must be independent and end up bound together due to lack of access control, as well as excessive delegation.
Ex: We have code tracking, as well as the use of private and internal members.
*Developers in most cases are trained to see what are the logical errors that have been accidentally inserted into their code. Errors of this type will range from the most forgotten cases of different edges, which are not treated to the point where there are logical errors which make possible the crash that can have systems from most. Code winds are some signals that our code needs to be refactored in order to improve the alignment, support but also readability.
The presence of code scents is a very serious topic, despite the names being perhaps a bit ridiculous. Anyone who has little experience in software development is aware that code winds also have the property of seriously slowing down software release.
With the use of code wind detection tools, but also making it possible to submit codes in short as well as controlled refactoring sessions, we have the opportunity to go beyond the initial impact of code winds. In this way we have the right to discover the deepest problem that lies within the software. Code winds can in many cases be vital to make it possible to discover when to refactor and what refactoring techniques to use.
There is a part that is very essential in the way the software is developed as well as to find the flavors of the code. Another role is to dig into the root causes but also to fix them through what is called refactoring.
Most common codes are:
- Bloaters
- Object-Orientation Abusers
- Change Preventers
- Dispensables
- Couplers
The ones that are found the most by details are :
Long method
Duplicate Code
Inheritance method
Data Clumps
Middle Man
Primitive types
Divergent Code
Shotgun Surgery
Feature EnvyPrimitive Obsession
Lazy Class
Type Embedded in Name
Uncommunicative Name
Dead Code
References:
https://levelup.gitconnected.com/10-programming-code-smells-that-affect-your-codebase-e66104e0341d
https://www.infoq.com/news/2016/09/refactoring-code-smells/
https://8thlight.com/blog/georgina-mcfadyen/2017/01/19/common-code-smells.html
From the blog CS@worcester – Xhulja's Blogs by xmurati and used with permission of the author. All other rights reserved by the author.