DEV Community

Code Smells Series' Articles

Back to Maxi Contieri's Series
Code Smell 01 - Anemic Models

Code Smell 01 - Anemic Models

Reactions 106 Comments 10
2 min read
Code Smell 02 - Constants and Magic Numbers

Code Smell 02 - Constants and Magic Numbers

Reactions 10 Comments
1 min read
Code Smell 03 - Functions Are Too Long

Code Smell 03 - Functions Are Too Long

Reactions 4 Comments 2
1 min read
Code Smell 04 - String Abusers

Code Smell 04 - String Abusers

Reactions 8 Comments
1 min read
Code Smell 05 - Comment Abusers

Code Smell 05 - Comment Abusers

Reactions 3 Comments 9
2 min read
Code Smell 06 - Too Clever Programmer

Code Smell 06 - Too Clever Programmer

Reactions 6 Comments 7
2 min read
Code Smell 07 - Boolean Variables

Code Smell 07 - Boolean Variables

Reactions 4 Comments
2 min read
Code Smell 08 - Long Chains Of Collaborations

Code Smell 08 - Long Chains Of Collaborations

Reactions 2 Comments
1 min read
Code Smell 09 - Dead Code

Code Smell 09 - Dead Code

Reactions 4 Comments
1 min read
Code Smell 10 - Too Many Arguments

Code Smell 10 - Too Many Arguments

Reactions 1 Comments
2 min read
Code Smell 11 - Subclassification for Code Reuse

Code Smell 11 - Subclassification for Code Reuse

Reactions 1 Comments
2 min read
Code Smell 12 - Null

Code Smell 12 - Null

Reactions 2 Comments 2
2 min read
Code Smell 13 - Empty Constructors

Code Smell 13 - Empty Constructors

Reactions 1 Comments
2 min read
Code Smell 14 - God Objects

Code Smell 14 - God Objects

Reactions 3 Comments
1 min read
Code Smell 15 - Missed Preconditions

Code Smell 15 - Missed Preconditions

Reactions 1 Comments
2 min read
Code Smell 16 - Ripple Effect

Code Smell 16 - Ripple Effect

Reactions 1 Comments
2 min read
Code Smell 17 - Global Functions

Code Smell 17 - Global Functions

Reactions 1 Comments
1 min read
Code Smell 18 — Static Functions

Code Smell 18 — Static Functions

Comments 4
2 min read
Code Smell 19 — Optional Arguments

Code Smell 19 — Optional Arguments

Reactions 5 Comments
2 min read
Code Smell 20 - Premature Optimization

Code Smell 20 - Premature Optimization

Reactions 3 Comments
2 min read
Code Smell 21 - Anonymous Functions Abusers

Code Smell 21 - Anonymous Functions Abusers

Reactions 6 Comments 2
2 min read
Code Smell 22 - Helpers

Code Smell 22 - Helpers

Reactions 10 Comments 4
2 min read
Code Smell 23 - Instance Type Checking

Code Smell 23 - Instance Type Checking

Reactions 3 Comments 3
2 min read
Code Smell 24 - Boolean Coercions

Code Smell 24 - Boolean Coercions

Reactions 11 Comments 17
2 min read
Code Smell 25 - Pattern Abusers

Code Smell 25 - Pattern Abusers

Reactions 4 Comments
2 min read
Code Smell 26 - Exceptions Polluting

Code Smell 26 - Exceptions Polluting

Reactions 3 Comments
2 min read
Code Smell 27 - Associative Arrays

Code Smell 27 - Associative Arrays

Reactions 2 Comments
2 min read
Code Smell 28 - Setters

Code Smell 28 - Setters

Reactions 3 Comments
2 min read
Code Smell 29 - Settings/Configs

Code Smell 29 - Settings/Configs

Reactions 7 Comments 4
2 min read
Code Smell 30 - Mocking Business

Code Smell 30 - Mocking Business

Reactions 3 Comments
1 min read
Code Smell 31 - Accidental Methods on Business Objects

Code Smell 31 - Accidental Methods on Business Objects

Reactions 4 Comments
1 min read
Code Smell 32 - Singletons

Code Smell 32 - Singletons

Reactions 5 Comments 2
2 min read
Code Smell 33 - Abbreviations

Code Smell 33 - Abbreviations

Reactions 7 Comments 5
2 min read
Code Smell 34 - Too Many Attributes

Code Smell 34 - Too Many Attributes

Reactions 12 Comments 7
1 min read
Code Smell 35 - State as Properties

Code Smell 35 - State as Properties

Reactions 11 Comments 2
1 min read
Code Smell 36 - Switch/case/elseif/else/if statements

Code Smell 36 - Switch/case/elseif/else/if statements

Reactions 9 Comments 2
1 min read
Code Smell 37 - Protected Attributes

Code Smell 37 - Protected Attributes

Reactions 4 Comments 1
2 min read
Code Smell 38 - Abstract Names

Code Smell 38 - Abstract Names

Reactions 3 Comments
1 min read
Code Smell 39 - new Date()

Code Smell 39 - new Date()

Reactions 5 Comments
1 min read
Code Smell 40 - DTOs

Code Smell 40 - DTOs

Reactions 4 Comments
2 min read
Code Smell 41 - Regular Expression Abusers

Code Smell 41 - Regular Expression Abusers

Reactions 7 Comments
1 min read
Code Smell 42 - Warnings/Strict Mode Off

Code Smell 42 - Warnings/Strict Mode Off

Reactions 2 Comments 3
2 min read
Code Smell 43 - Concrete Classes Subclassified

Code Smell 43 - Concrete Classes Subclassified

Reactions 6 Comments
1 min read
Code Smell 44 - Magic Corrections

Code Smell 44 - Magic Corrections

Reactions 4 Comments
1 min read
Code Smell 45 - Not Polymorphic

Code Smell 45 - Not Polymorphic

Reactions 2 Comments
1 min read
Code Smell 46 - Repeated Code

Code Smell 46 - Repeated Code

Reactions 4 Comments
1 min read
Code Smell 47 - Diagrams

Code Smell 47 - Diagrams

Reactions 7 Comments 1
2 min read
Code Smell 48 - Code Without Standards

Code Smell 48 - Code Without Standards

Reactions 4 Comments 1
1 min read
Code Smell 49 - Caches

Code Smell 49 - Caches

Reactions 1 Comments
1 min read
Code Smell 50 - Object Keys

Code Smell 50 - Object Keys

Reactions 11 Comments 2
2 min read
Code Smell 51 - Double Negatives

Code Smell 51 - Double Negatives

Reactions 7 Comments 5
1 min read
Code Smell 52 - Fragile Tests

Code Smell 52 - Fragile Tests

Comments 1
2 min read
Code Smell 53 - Explicit Iteration

Code Smell 53 - Explicit Iteration

Reactions 15 Comments 15
2 min read
Code Smell 54 - Anchor Boats

Code Smell 54 - Anchor Boats

Reactions 4 Comments 2
2 min read
Code Smell 55 - Object Orgy

Code Smell 55 - Object Orgy

Comments
2 min read
Code Smell 56 - Preprocessors

Code Smell 56 - Preprocessors

Comments 4
2 min read
Code Smell 57 - Versioned Functions

Code Smell 57 - Versioned Functions

Reactions 2 Comments 3
1 min read
Code Smell 58 - Yo-yo Problem

Code Smell 58 - Yo-yo Problem

Reactions 2 Comments
2 min read
Code Smell 59 - Basic / Do Functions

Code Smell 59 - Basic / Do Functions

Reactions 5 Comments
2 min read
Code Smell 60 - Global Classes

Code Smell 60 - Global Classes

Reactions 3 Comments 3
2 min read
Code Smell 61 - Coupling to Classes

Code Smell 61 - Coupling to Classes

Reactions 6 Comments 5
2 min read
Code Smell 62 - Flag Variables

Code Smell 62 - Flag Variables

Reactions 1 Comments 1
1 min read
Code Smell 63 - Feature Envy

Code Smell 63 - Feature Envy

Reactions 4 Comments 2
2 min read
Code Smell 64 - Inappropriate Intimacy

Code Smell 64 - Inappropriate Intimacy

Reactions 7 Comments
1 min read
Code Smell 65 - Variables Named After Types

Code Smell 65 - Variables Named After Types

Reactions 5 Comments 1
1 min read
Code Smell 66 - Shotgun Surgery

Code Smell 66 - Shotgun Surgery

Reactions 4 Comments 5
2 min read
Code Smell 67 - Middle Man

Code Smell 67 - Middle Man

Reactions 2 Comments
1 min read
Code Smell 68 - Getters

Code Smell 68 - Getters

Reactions 3 Comments 2
2 min read
Code Smell 69 - Big Bang (JavaScript Ridiculous Castings)

Code Smell 69 - Big Bang (JavaScript Ridiculous Castings)

Reactions 6 Comments
2 min read
Code Smell 70 - Anemic Model Generators

Code Smell 70 - Anemic Model Generators

Reactions 5 Comments
2 min read
Code Smell 71 - Magic Floats Disguised as Decimals

Code Smell 71 - Magic Floats Disguised as Decimals

Reactions 3 Comments
2 min read
Code Smell 72 - Return Codes

Code Smell 72 - Return Codes

Reactions 2 Comments 4
2 min read
Code Smell 73 - Exceptions for Expected Cases

Code Smell 73 - Exceptions for Expected Cases

Reactions 6 Comments
2 min read
Code Smell 74 - Empty Lines

Code Smell 74 - Empty Lines

Reactions 6 Comments 4
1 min read
Code Smell 75 - Comments Inside a Method

Code Smell 75 - Comments Inside a Method

Reactions 6 Comments
2 min read
Code Smell 76 - Generic Assertions

Code Smell 76 - Generic Assertions

Reactions 5 Comments
2 min read
Code Smell 77 - Timestamps

Code Smell 77 - Timestamps

Reactions 3 Comments
2 min read
Code Smell 78 - Callback Hell

Code Smell 78 - Callback Hell

Reactions 2 Comments
2 min read
Code Smell 79 - TheResult

Code Smell 79 - TheResult

Reactions 4 Comments
1 min read
Code Smell 80 - Nested Try/Catch

Code Smell 80 - Nested Try/Catch

Reactions 5 Comments
2 min read
Code Smell 81 - Result

Code Smell 81 - Result

Reactions 6 Comments 6
1 min read
Code Smell 82 - Tests Violating Encapsulation

Code Smell 82 - Tests Violating Encapsulation

Reactions 5 Comments 6
2 min read
Code Smell 83 - Variables Reassignment

Code Smell 83 - Variables Reassignment

Comments
2 min read
Code Smell 84 - Max < Min (Javascript)

Code Smell 84 - Max < Min (Javascript)

Reactions 2 Comments
2 min read
Code Smell 85 - And Functions

Code Smell 85 - And Functions

Reactions 4 Comments
1 min read
Code Smell 86 - Mutable Const Arrays

Code Smell 86 - Mutable Const Arrays

Reactions 2 Comments
1 min read
Code Smell 87 - Inconsistent Parameters Sorting

Code Smell 87 - Inconsistent Parameters Sorting

Reactions 5 Comments 1
1 min read
Code Smell 88 - Lazy Initialization

Code Smell 88 - Lazy Initialization

Reactions 5 Comments
2 min read
Code Smell 89 - Math Feature Envy

Code Smell 89 - Math Feature Envy

Reactions 6 Comments 4
2 min read
Code Smell 90 - Implementative Callback Events

Code Smell 90 - Implementative Callback Events

Reactions 4 Comments
1 min read
Code Smell 91 - Test Asserts without Description

Code Smell 91 - Test Asserts without Description

Reactions 1 Comments
1 min read
Code Smell 92 - Isolated Subclasses Names

Code Smell 92 - Isolated Subclasses Names

Reactions 5 Comments
2 min read
Code Smell 93 - Send me Anything

Code Smell 93 - Send me Anything

Reactions 6 Comments 1
2 min read
Code Smell 94 - Too Many imports

Code Smell 94 - Too Many imports

Reactions 6 Comments
2 min read
Code Smell 95 - Premature Classification

Code Smell 95 - Premature Classification

Reactions 5 Comments
2 min read
Code Smell 96 - My Objects

Code Smell 96 - My Objects

Reactions 6 Comments
1 min read
Code Smell 97 - Error Messages Without Empathy

Code Smell 97 - Error Messages Without Empathy

Reactions 5 Comments
1 min read
Code Smell 98 - Speling Mistakes

Code Smell 98 - Speling Mistakes

Reactions 5 Comments
1 min read
Code Smell 99 - First Second

Code Smell 99 - First Second

Reactions 6 Comments
1 min read
Code Smell 100 - GoTo

Code Smell 100 - GoTo

Reactions 6 Comments
2 min read
Code Smell 101 - Comparison Against Booleans

Code Smell 101 - Comparison Against Booleans

Reactions 6 Comments
2 min read
Code Smell 102 - Arrow Code

Code Smell 102 - Arrow Code

Reactions 6 Comments
2 min read
Code Smell 103 - Double Encapsulation

Code Smell 103 - Double Encapsulation

Reactions 3 Comments
2 min read
Code Smell 104 - Assert True

Code Smell 104 - Assert True

Reactions 3 Comments
2 min read
Code Smell 105 - Comedian Methods

Code Smell 105 - Comedian Methods

Reactions 2 Comments 4
2 min read
Code Smell 106 - Production Dependent Code

Code Smell 106 - Production Dependent Code

Reactions 1 Comments
2 min read
Code Smell 107 - Variables Reuse

Code Smell 107 - Variables Reuse

Reactions 5 Comments 1
2 min read
Code Smell 108 - Float Assertions

Code Smell 108 - Float Assertions

Reactions 4 Comments
2 min read
Code Smell 109 - Automatic Properties

Code Smell 109 - Automatic Properties

Reactions 6 Comments 6
2 min read
Code Smell 110 - Switches With Defaults

Code Smell 110 - Switches With Defaults

Reactions 6 Comments
2 min read
Code Smell 111 - Modifying Collections While Traversing

Code Smell 111 - Modifying Collections While Traversing

Reactions 6 Comments
2 min read
Code Smell 112 - Testing Private Methods

Code Smell 112 - Testing Private Methods

Reactions 4 Comments
2 min read
Code Smell 113 - Data Naming

Code Smell 113 - Data Naming

Reactions 5 Comments
2 min read
Code Smell 114 - Empty Class

Code Smell 114 - Empty Class

Reactions 7 Comments
2 min read
Code Smell 115 - Return True

Code Smell 115 - Return True

Reactions 7 Comments 1
2 min read
Code Smell 116 - Variables Declared With 'var'

Code Smell 116 - Variables Declared With 'var'

Reactions 6 Comments
2 min read
Code Smell 117 - Unrealistic Data

Code Smell 117 - Unrealistic Data

Reactions 4 Comments
3 min read
Code Smell 118 - Return False

Code Smell 118 - Return False

Reactions 6 Comments 5
2 min read
Code Smell 119 - Stairs Code

Code Smell 119 - Stairs Code

Reactions 5 Comments
2 min read
Code Smell 120 - Sequential IDs

Code Smell 120 - Sequential IDs

Reactions 6 Comments 2
2 min read
Code Smell 121 - String Validations

Code Smell 121 - String Validations

Reactions 6 Comments
3 min read
Code Smell 122 - Primitive Obsession

Code Smell 122 - Primitive Obsession

Reactions 11 Comments
2 min read
Code Smell 123 - Mixed 'What' and 'How'

Code Smell 123 - Mixed 'What' and 'How'

Reactions 7 Comments
2 min read
Code Smell 124 - Divergent Change

Code Smell 124 - Divergent Change

Reactions 6 Comments
2 min read
Code Smell 125 - 'IS-A' Relationship

Code Smell 125 - 'IS-A' Relationship

Reactions 8 Comments 4
3 min read
Code Smell 126 - Fake Null Object

Code Smell 126 - Fake Null Object

Reactions 10 Comments
3 min read
Code Smell 127 - Mutable Constants