TL;DR: A Compilation of bad smells in code.
The code smells badly.
Let's see how to change the aromas.
In this series, we will see several symptoms and situations that make us doubt the quality of our development. We will present possible solutions.
Most of these smells are just hints of something that might be wrong. They are not rigid rules.
Code Smells
Code Smell 01 - Anemic Models
Maxi Contieri ・ Oct 20 '20
Code Smell 02 - Constants and Magic Numbers
Maxi Contieri ・ Oct 21 '20
Code Smell 149 - Optional Chaining
Maxi Contieri ・ Jul 16 '22
Code Smell 04 - String Abusers
Maxi Contieri ・ Oct 23 '20
Code Smell 08 - Long Chains Of Collaborations
Maxi Contieri ・ Oct 27 '20
Code Smell 10 - Too Many Arguments
Maxi Contieri ・ Oct 29 '20
Code Smell 11 - Subclassification for Code Reuse
Maxi Contieri ・ Oct 30 '20
Code Smell 18 — Static Functions
Maxi Contieri ・ Nov 6 '20
Code Smell 20 - Premature Optimization
Maxi Contieri ・ Nov 8 '20
Code Smell 21 - Anonymous Functions Abusers
Maxi Contieri ・ Nov 10 '20
Code Smell 26 - Exceptions Polluting
Maxi Contieri ・ Nov 16 '20
Code Smell 31 - Accidental Methods on Business Objects
Maxi Contieri ・ Nov 22 '20
Code Smell 36 - Switch/case/elseif/else/if statements
Maxi Contieri ・ Nov 28 '20
Code Smell 41 - Regular Expression Abusers
Maxi Contieri ・ Dec 3 '20
Code Smell 42 - Warnings/Strict Mode Off
Maxi Contieri ・ Dec 4 '20
Code Smell 43 - Concrete Classes Subclassified
Maxi Contieri ・ Dec 5 '20
Code Smell 48 - Code Without Standards
Maxi Contieri ・ Dec 10 '20
Code Smell 53 - Explicit Iteration
Maxi Contieri ・ Jan 5 '21
Code Smell 56 - Preprocessors
Maxi Contieri ・ Jan 18 '21
Code Smell 57 - Versioned Functions
Maxi Contieri ・ Jan 20 '21
Code Smell 59 - Basic / Do Functions
Maxi Contieri ・ Jan 27 '21
Code Smell 60 - Global Classes
Maxi Contieri ・ Jan 31 '21
Code Smell 61 - Coupling to Classes
Maxi Contieri ・ Feb 4 '21
Code Smell 64 - Inappropriate Intimacy
Maxi Contieri ・ Mar 27 '21
Code Smell 65 - Variables Named After Types
Maxi Contieri ・ Apr 2 '21
Code Smell 69 - Big Bang (JavaScript Ridiculous Castings)
Maxi Contieri ・ May 4 '21
Code Smell 70 - Anemic Model Generators
Maxi Contieri ・ May 18 '21
Code Smell 71 - Magic Floats Disguised as Decimals
Maxi Contieri ・ May 24 '21
Code Smell 73 - Exceptions for Expected Cases
Maxi Contieri ・ May 31 '21
Code Smell 75 - Comments Inside a Method
Maxi Contieri ・ Jun 5 '21
Code Smell 82 - Tests Violating Encapsulation
Maxi Contieri ・ Jun 25 '21
Code Smell 83 - Variables Reassignment
Maxi Contieri ・ Jul 14 '21
Code Smell 84 - Max < Min (Javascript)
Maxi Contieri ・ Jul 20 '21
Code Smell 86 - Mutable Const Arrays
Maxi Contieri ・ Aug 25 '21
Code Smell 87 - Inconsistent Parameters Sorting
Maxi Contieri ・ Sep 26 '21
Code Smell 87 - Inconsistent Parameters Sorting
Maxi Contieri ・ Sep 26 '21
Code Smell 90 - Implementative Callback Events
Maxi Contieri ・ Oct 7 '21
Code Smell 91 - Test Asserts without Description
Maxi Contieri ・ Oct 8 '21
Code Smell 92 - Isolated Subclasses Names
Maxi Contieri ・ Oct 11 '21
Code Smell 90 - Implementative Callback Events
Maxi Contieri ・ Oct 7 '21
Code Smell 95 - Premature Classification
Maxi Contieri ・ Oct 16 '21
Code Smell 97 - Error Messages Without Empathy
Maxi Contieri ・ Oct 27 '21
Code Smell 101 - Comparison Against Booleans
Maxi Contieri ・ Nov 11 '21
Code Smell 106 - Production Dependent Code
Maxi Contieri ・ Nov 27 '21
Code Smell 110 - Switches With Defaults
Maxi Contieri ・ Dec 15 '21
Code Smell 111 - Modifying Collections While Traversing
Maxi Contieri ・ Dec 19 '21
Code Smell 127 - Mutable Constants
Maxi Contieri ・ Apr 5 '22
Code Smell 128 - Non English Coding
Maxi Contieri ・ Apr 9 '22
Code Smell 129 - Structural Optimizations
Maxi Contieri ・ Apr 12 '22
Code Smell 132 - Exception Try Too Broad
Maxi Contieri ・ May 18 '22
Code Smell 133 - Hardcoded IF Conditions
Maxi Contieri ・ May 20 '22
Code Smell 134 - Specialized Business Collections
Maxi Contieri ・ May 22 '22
Code Smell 135 - Interfaces With just One Realization
Maxi Contieri ・ May 26 '22
Code Smell 137 - Inheritance Tree Too Deep
Maxi Contieri ・ May 31 '22
Code Smell 139 - Business Code in the User Interface
Maxi Contieri ・ Jun 9 '22
Code Smell 140 - Short Circuit Evaluation
Maxi Contieri ・ Jun 13 '22
Code Smell 141 - IEngine , AVehicle, ImplCar
Maxi Contieri ・ Jun 18 '22
Code Smell 142 - Queries in Constructors
Maxi Contieri ・ Jun 20 '22
Code Smell 144 - Fungible Objects
Maxi Contieri ・ Jun 25 '22
Code Smell 145 - Short Circuit Hack
Maxi Contieri ・ Jun 30 '22
Code Smell 146 - Getter Comments
Maxi Contieri ・ Jul 2 '22
Code Smell 149 - Optional Chaining
Maxi Contieri ・ Jul 16 '22
Code Smell 150 - Equal Comparison
Maxi Contieri ・ Jul 19 '22
Code Smell 151 - Commented Code
Maxi Contieri ・ Jul 22 '22
Code Smell 152 - Logical Comment
Maxi Contieri ・ Jul 24 '22
Code Smell 153 - Too Long Names
Maxi Contieri ・ Jul 29 '22
Code Smell 154 - Too Many Variables
Maxi Contieri ・ Jul 31 '22
Code Smell 155 - Multiple Promises
Maxi Contieri ・ Aug 3 '22
Code Smell 156 - Implicit Else
Maxi Contieri ・ Aug 6 '22
Code Smell 158 - Variables not Variable
Maxi Contieri ・ Aug 13 '22
Code Smell 161 - Abstract/Final/Undefined Classes
Maxi Contieri ・ Sep 2 '22
Code Smell 162 - Too Many Parentheses
Maxi Contieri ・ Sep 10 '22
Code Smell 163 - Collection in Name
Maxi Contieri ・ Sep 16 '22
Code Smell 164 - Mixed Indentations
Maxi Contieri ・ Sep 21 '22
Code Smell 165 - Empty Exception Blocks
Maxi Contieri ・ Sep 24 '22
Code Smell 166 - Low-Level Errors on User Interface
Maxi Contieri ・ Sep 28 '22
Code Smell 167 - Hashing Comparison
Maxi Contieri ・ Oct 9 '22
Code Smell 168 - Undocumented Decisions
Maxi Contieri ・ Oct 11 '22
Code Smell 170 - Refactor with Functional Changes
Maxi Contieri ・ Oct 18 '22
Code Smell 171 - Plural Classes
Maxi Contieri ・ Oct 21 '22
Code Smell 172 - Default Argument Values Not Last
Maxi Contieri ・ Oct 22 '22
Code Smell 173 - Broken Windows
Maxi Contieri ・ Oct 27 '22
Code Smell 174 - Class Name in Attributes
Maxi Contieri ・ Oct 29 '22
Code Smell 175 - Changes Without Coverage
Maxi Contieri ・ Oct 31 '22
Code Smell 176 - Changes in Essence
Maxi Contieri ・ Nov 2 '22
Code Smell 177 - Missing Small Objects
Maxi Contieri ・ Nov 5 '22
Code Smell 178 - Subsets Violation
Maxi Contieri ・ Nov 10 '22
Code Smell 180 - BitWise Optimizations
Maxi Contieri ・ Nov 19 '22
Code Smell 182 - Over Generalization
Maxi Contieri ・ Nov 27 '22
Code Smell 183 - Obsolete Comments
Maxi Contieri ・ Dec 2 '22
Code Smell 184 - Exception Arrow Code
Maxi Contieri ・ Dec 4 '22
Code Smell 185 - Evil Regular Expressions
Maxi Contieri ・ Dec 8 '22
Code Smell 186 - Hardcoded Business Conditions
Maxi Contieri ・ Dec 14 '22
ㄥ8Ɩ llǝɯS ǝpoƆ - spɹɐʍʞɔɐq ǝslƎ/ℲI
Maxi Contieri ・ Dec 17 '22
Code Smell 188 - Redundant Parameter Names
Maxi Contieri ・ Dec 24 '22
Code Smell 189 - Not Sanitized Input
Maxi Contieri ・ Dec 28 '22
Code Smell 190 - Unnecessary Properties
Maxi Contieri ・ Jan 3 '23
Code Smell 191 - Misplaced Responsibility
Maxi Contieri ・ Jan 9 '23
Code Smell 192 - Optional Attributes
Maxi Contieri ・ Jan 17 '23
Code Smell 193 - Switch Instead of Formula
Maxi Contieri ・ Jan 27 '23
Code Smell 195 - Yoda Conditions
Maxi Contieri ・ Feb 7 '23
Code Smell 196 - Javascript Array Constructors
Maxi Contieri ・ Feb 16 '23
Code Smell 197 - Gratuitous Context
Maxi Contieri ・ Feb 21 '23
Code Smell 198 - Hidden Assumptions
Maxi Contieri ・ Mar 2 '23
Code Smell 199 - Gratuitous Booleans
Maxi Contieri ・ Mar 6 '23
Code Smell 201 - Nested Ternaries
Maxi Contieri ・ Mar 14 '23
Code Smell 202 - God Constant Class
Maxi Contieri ・ Mar 18 '23
Code Smell 203 - Irrelevant Test Information
Maxi Contieri ・ Mar 26 '23
Code Smell 204 - Tests Depending on Dates
Maxi Contieri ・ Mar 28 '23
Code Smell 205 - Code in Destructors
Maxi Contieri ・ Apr 9 '23
Code Smell 206 - Long Ternaries
Maxi Contieri ・ Apr 11 '23
Code Smell 209 - Side Effects
Maxi Contieri ・ Apr 28 '23
Code Smell 210 - Dynamic Properties
Maxi Contieri ・ May 1 '23
Code Smell 211 - Tab over Spaces
Maxi Contieri ・ May 6 '23
Code Smell 212 - Elvis Operator
Maxi Contieri ・ May 13 '23
Code Smell 214 - Duplicate Parameter Names
Maxi Contieri ・ May 26 '23
Code Smell 215 - Deserializing Object Vulnerability
Maxi Contieri ・ Jun 1 '23
Code Smell 216 - Fat Interface
Maxi Contieri ・ Jun 4 '23
Code Smell 217 - Empty Implementation
Maxi Contieri ・ Jun 18 '23
Code Smell 218 - Magic Concatenation
Maxi Contieri ・ Jul 16 '23
Code Smell 219 - Looping from index 0
Maxi Contieri ・ Jul 24 '23
Code Smell 221 - Missing Break in Switch
Maxi Contieri ・ Aug 7 '23
Code Smell 222 - Comma Operator
Maxi Contieri ・ Aug 28 '23
Code Smell 224 - Deodorant Comments
Maxi Contieri ・ Sep 10 '23
Code Smell 225 - Pass by Reference
Maxi Contieri ・ Sep 25 '23
Code Smell 228 - Multiple Classes per File
Maxi Contieri ・ Oct 21 '23
Code Smell 230 - Schrödinger Code
Maxi Contieri ・ Nov 4 '23
Code Smell 231 - Redundant Data
Maxi Contieri ・ Nov 11 '23
Code Smell 232 - Reusable Code
Maxi Contieri ・ Nov 25 '23
Code Smell 233 - Collections Count
Maxi Contieri ・ Dec 1 '23
... and many more to come.
Photo by Richárd Ecsedi on Unsplash
Smells are certain structures in the code that suggest (sometimes they scream for) the possibility of refactoring
Martin Fowler
Software Engineering Great Quotes
Maxi Contieri ・ Dec 28 '20
Part of the objective of this series of articles is to generate spaces for debate and discussion on software design.
We look forward to your comments and suggestions on this article.
Original Thread on Twitter