DEV Community

Code Smells Series' Articles

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

Code Smell 01 - Anemic Models

61
Comments 12
2 min read
Code Smell 02 - Constants and Magic Numbers
Cover image for Code Smell 02 - Constants and Magic Numbers

Code Smell 02 - Constants and Magic Numbers

25
Comments 1
1 min read
Code Smell 03 - Functions Are Too Long
Cover image for Code Smell 03 - Functions Are Too Long

Code Smell 03 - Functions Are Too Long

7
Comments 4
1 min read
Code Smell 04 - String Abusers
Cover image for Code Smell 04 - String Abusers

Code Smell 04 - String Abusers

12
Comments
1 min read
Code Smell 05 - Comment Abusers
Cover image for Code Smell 05 - Comment Abusers

Code Smell 05 - Comment Abusers

5
Comments 11
2 min read
Code Smell 06 - Too Clever Programmer
Cover image for Code Smell 06 - Too Clever Programmer

Code Smell 06 - Too Clever Programmer

10
Comments 7
2 min read
Code Smell 07 - Boolean Variables
Cover image for Code Smell 07 - Boolean Variables

Code Smell 07 - Boolean Variables

8
Comments 2
2 min read
Code Smell 08 - Long Chains Of Collaborations
Cover image for Code Smell 08 - Long Chains Of Collaborations

Code Smell 08 - Long Chains Of Collaborations

4
Comments
1 min read
Code Smell 09 - Dead Code
Cover image for Code Smell 09 - Dead Code

Code Smell 09 - Dead Code

2
Comments
1 min read
Code Smell 10 - Too Many Arguments
Cover image for Code Smell 10 - Too Many Arguments

Code Smell 10 - Too Many Arguments

3
Comments 1
2 min read
Code Smell 11 - Subclassification for Code Reuse
Cover image for Code Smell 11 - Subclassification for Code Reuse

Code Smell 11 - Subclassification for Code Reuse

1
Comments 1
2 min read
Code Smell 12 - Null
Cover image for Code Smell 12 - Null

Code Smell 12 - Null

4
Comments 3
2 min read
Code Smell 13 - Empty Constructors
Cover image for Code Smell 13 - Empty Constructors

Code Smell 13 - Empty Constructors

1
Comments
2 min read
Code Smell 14 - God Objects
Cover image for Code Smell 14 - God Objects

Code Smell 14 - God Objects

3
Comments 2
1 min read
Code Smell 15 - Missed Preconditions
Cover image for Code Smell 15 - Missed Preconditions

Code Smell 15 - Missed Preconditions

1
Comments
2 min read
Code Smell 16 - Ripple Effect
Cover image for Code Smell 16 - Ripple Effect

Code Smell 16 - Ripple Effect

1
Comments
2 min read
Code Smell 17 - Global Functions
Cover image for Code Smell 17 - Global Functions

Code Smell 17 - Global Functions

1
Comments
1 min read
Code Smell 18 — Static Functions
Cover image for Code Smell 18 — Static Functions

Code Smell 18 — Static Functions

2
Comments 4
2 min read
Code Smell 19 — Optional Arguments
Cover image for Code Smell 19 — Optional Arguments

Code Smell 19 — Optional Arguments

5
Comments
2 min read
Code Smell 20 - Premature Optimization
Cover image for Code Smell 20 - Premature Optimization

Code Smell 20 - Premature Optimization

3
Comments
2 min read
Code Smell 21 - Anonymous Functions Abusers
Cover image for Code Smell 21 - Anonymous Functions Abusers

Code Smell 21 - Anonymous Functions Abusers

6
Comments 8
2 min read
Code Smell 22 - Helpers
Cover image for Code Smell 22 - Helpers

Code Smell 22 - Helpers

10
Comments 4
2 min read
Code Smell 23 - Instance Type Checking
Cover image for Code Smell 23 - Instance Type Checking

Code Smell 23 - Instance Type Checking

4
Comments 3
2 min read
Code Smell 24 - Boolean Coercions
Cover image for Code Smell 24 - Boolean Coercions

Code Smell 24 - Boolean Coercions

12
Comments 30
2 min read
Code Smell 25 - Pattern Abusers
Cover image for Code Smell 25 - Pattern Abusers

Code Smell 25 - Pattern Abusers

4
Comments
2 min read
Code Smell 26 - Exceptions Polluting
Cover image for Code Smell 26 - Exceptions Polluting

Code Smell 26 - Exceptions Polluting

3
Comments
2 min read
Code Smell 27 - Associative Arrays
Cover image for Code Smell 27 - Associative Arrays

Code Smell 27 - Associative Arrays

2
Comments
2 min read
Code Smell 28 - Setters
Cover image for Code Smell 28 - Setters

Code Smell 28 - Setters

5
Comments
2 min read
Code Smell 29 - Settings/Configs

Code Smell 29 - Settings/Configs

7
Comments 4
2 min read
Code Smell 30 - Mocking Business
Cover image for Code Smell 30 - Mocking Business

Code Smell 30 - Mocking Business

3
Comments
1 min read
Code Smell 31 - Accidental Methods on Business Objects
Cover image for Code Smell 31 - Accidental Methods on Business Objects

Code Smell 31 - Accidental Methods on Business Objects

4
Comments
1 min read
Code Smell 32 - Singletons
Cover image for Code Smell 32 - Singletons

Code Smell 32 - Singletons

6
Comments 2
2 min read
Code Smell 33 - Abbreviations
Cover image for Code Smell 33 - Abbreviations

Code Smell 33 - Abbreviations

7
Comments 5
2 min read
Code Smell 34 - Too Many Attributes
Cover image for Code Smell 34 - Too Many Attributes

Code Smell 34 - Too Many Attributes

13
Comments 7
1 min read
Code Smell 35 - State as Properties
Cover image for Code Smell 35 - State as Properties

Code Smell 35 - State as Properties

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

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

9
Comments 3
1 min read
Code Smell 37 - Protected Attributes
Cover image for Code Smell 37 - Protected Attributes

Code Smell 37 - Protected Attributes

4
Comments 1
2 min read
Code Smell 38 - Abstract Names
Cover image for Code Smell 38 - Abstract Names

Code Smell 38 - Abstract Names

3
Comments
1 min read
Code Smell 39 - new Date()
Cover image for Code Smell 39 - new Date()

Code Smell 39 - new Date()

5
Comments
1 min read
Code Smell 40 - DTOs
Cover image for Code Smell 40 - DTOs

Code Smell 40 - DTOs

4
Comments
2 min read
Code Smell 41 - Regular Expression Abusers
Cover image for Code Smell 41 - Regular Expression Abusers

Code Smell 41 - Regular Expression Abusers

7
Comments
1 min read
Code Smell 42 - Warnings/Strict Mode Off
Cover image for Code Smell 42 - Warnings/Strict Mode Off

Code Smell 42 - Warnings/Strict Mode Off

3
Comments 3
2 min read
Code Smell 43 - Concrete Classes Subclassified
Cover image for Code Smell 43 - Concrete Classes Subclassified

Code Smell 43 - Concrete Classes Subclassified

6
Comments
1 min read
Code Smell 44 - Magic Corrections
Cover image for Code Smell 44 - Magic Corrections

Code Smell 44 - Magic Corrections

4
Comments
1 min read
Code Smell 45 - Not Polymorphic
Cover image for Code Smell 45 - Not Polymorphic

Code Smell 45 - Not Polymorphic

2
Comments
1 min read
Code Smell 46 - Repeated Code
Cover image for Code Smell 46 - Repeated Code

Code Smell 46 - Repeated Code

4
Comments
1 min read
Code Smell 47 - Diagrams
Cover image for Code Smell 47 - Diagrams

Code Smell 47 - Diagrams

7
Comments 1
2 min read
Code Smell 48 - Code Without Standards
Cover image for Code Smell 48 - Code Without Standards

Code Smell 48 - Code Without Standards

4
Comments 1
1 min read
Code Smell 49 - Caches
Cover image for Code Smell 49 - Caches

Code Smell 49 - Caches

1
Comments
1 min read
Code Smell 50 - Object Keys
Cover image for Code Smell 50 - Object Keys

Code Smell 50 - Object Keys

11
Comments 2
2 min read
Code Smell 51 - Double Negatives
Cover image for Code Smell 51 - Double Negatives

Code Smell 51 - Double Negatives

7
Comments 5
1 min read
Code Smell 52 - Fragile Tests
Cover image for Code Smell 52 - Fragile Tests

Code Smell 52 - Fragile Tests

Comments 1
2 min read
Code Smell 53 - Explicit Iteration
Cover image for Code Smell 53 - Explicit Iteration

Code Smell 53 - Explicit Iteration

15
Comments 15
2 min read
Code Smell 54 - Anchor Boats
Cover image for Code Smell 54 - Anchor Boats

Code Smell 54 - Anchor Boats

4
Comments 2
2 min read
Code Smell 55 - Object Orgy
Cover image for Code Smell 55 - Object Orgy

Code Smell 55 - Object Orgy

Comments
2 min read
Code Smell 56 - Preprocessors
Cover image for Code Smell 56 - Preprocessors

Code Smell 56 - Preprocessors

Comments 5
2 min read
Code Smell 57 - Versioned Functions
Cover image for Code Smell 57 - Versioned Functions

Code Smell 57 - Versioned Functions

2
Comments 3
1 min read
Code Smell 58 - Yo-yo Problem
Cover image for Code Smell 58 - Yo-yo Problem

Code Smell 58 - Yo-yo Problem

2
Comments
2 min read
Code Smell 59 - Basic / Do Functions
Cover image for Code Smell 59 - Basic / Do Functions

Code Smell 59 - Basic / Do Functions

5
Comments
2 min read
Code Smell 60 - Global Classes
Cover image for Code Smell 60 - Global Classes

Code Smell 60 - Global Classes

3
Comments 3
2 min read
Code Smell 61 - Coupling to Classes
Cover image for Code Smell 61 - Coupling to Classes

Code Smell 61 - Coupling to Classes

6
Comments 5
2 min read
Code Smell 62 - Flag Variables
Cover image for Code Smell 62 - Flag Variables

Code Smell 62 - Flag Variables

1
Comments 1
1 min read
Code Smell 63 - Feature Envy
Cover image for Code Smell 63 - Feature Envy

Code Smell 63 - Feature Envy

6
Comments 2
2 min read
Code Smell 64 - Inappropriate Intimacy
Cover image for Code Smell 64 - Inappropriate Intimacy

Code Smell 64 - Inappropriate Intimacy

7
Comments
1 min read
Code Smell 65 - Variables Named After Types
Cover image for Code Smell 65 - Variables Named After Types

Code Smell 65 - Variables Named After Types

5
Comments 1
1 min read
Code Smell 66 - Shotgun Surgery
Cover image for Code Smell 66 - Shotgun Surgery

Code Smell 66 - Shotgun Surgery

4
Comments 5
2 min read
Code Smell 67 - Middle Man
Cover image for Code Smell 67 - Middle Man

Code Smell 67 - Middle Man

2
Comments
1 min read
Code Smell 68 - Getters
Cover image for Code Smell 68 - Getters

Code Smell 68 - Getters

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

Code Smell 69 - Big Bang (JavaScript Ridiculous Castings)

4
Comments
2 min read
Code Smell 70 - Anemic Model Generators
Cover image for Code Smell 70 - Anemic Model Generators

Code Smell 70 - Anemic Model Generators

5
Comments
2 min read
Code Smell 71 - Magic Floats Disguised as Decimals
Cover image for Code Smell 71 - Magic Floats Disguised as Decimals

Code Smell 71 - Magic Floats Disguised as Decimals

3
Comments
2 min read
Code Smell 72 - Return Codes
Cover image for Code Smell 72 - Return Codes

Code Smell 72 - Return Codes

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

Code Smell 73 - Exceptions for Expected Cases

6
Comments
2 min read
Code Smell 74 - Empty Lines
Cover image for Code Smell 74 - Empty Lines

Code Smell 74 - Empty Lines

4
Comments 4
1 min read
Code Smell 75 - Comments Inside a Method
Cover image for Code Smell 75 - Comments Inside a Method

Code Smell 75 - Comments Inside a Method

6
Comments
2 min read
Code Smell 76 - Generic Assertions
Cover image for Code Smell 76 - Generic Assertions

Code Smell 76 - Generic Assertions

5
Comments
2 min read
Code Smell 77 - Timestamps
Cover image for Code Smell 77 - Timestamps

Code Smell 77 - Timestamps

4
Comments
2 min read
Code Smell 78 - Callback Hell
Cover image for Code Smell 78 - Callback Hell

Code Smell 78 - Callback Hell

2
Comments
2 min read
Code Smell 79 - TheResult
Cover image for Code Smell 79 - TheResult

Code Smell 79 - TheResult

4
Comments
1 min read
Code Smell 80 - Nested Try/Catch
Cover image for Code Smell 80 - Nested Try/Catch

Code Smell 80 - Nested Try/Catch

5
Comments
2 min read
Code Smell 81 - Result
Cover image for Code Smell 81 - Result

Code Smell 81 - Result

6
Comments 6
1 min read
Code Smell 82 - Tests Violating Encapsulation
Cover image for Code Smell 82 - Tests Violating Encapsulation

Code Smell 82 - Tests Violating Encapsulation

5
Comments 6
2 min read
Code Smell 83 - Variables Reassignment
Cover image for Code Smell 83 - Variables Reassignment

Code Smell 83 - Variables Reassignment

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

Code Smell 84 - Max < Min (Javascript)

2
Comments
2 min read
Code Smell 85 - And Functions
Cover image for Code Smell 85 - And Functions

Code Smell 85 - And Functions

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

Code Smell 86 - Mutable Const Arrays

2
Comments
1 min read
Code Smell 87 - Inconsistent Parameters Sorting
Cover image for Code Smell 87 - Inconsistent Parameters Sorting

Code Smell 87 - Inconsistent Parameters Sorting

5
Comments 1
1 min read
Code Smell 88 - Lazy Initialization
Cover image for Code Smell 88 - Lazy Initialization

Code Smell 88 - Lazy Initialization

5
Comments
2 min read
Code Smell 89 - Math Feature Envy
Cover image for Code Smell 89 - Math Feature Envy

Code Smell 89 - Math Feature Envy

6
Comments 4
2 min read
Code Smell 90 - Implementative Callback Events
Cover image for Code Smell 90 - Implementative Callback Events

Code Smell 90 - Implementative Callback Events

4
Comments
1 min read
Code Smell 91 - Test Asserts without Description
Cover image for Code Smell 91 - Test Asserts without Description

Code Smell 91 - Test Asserts without Description

1
Comments
1 min read
Code Smell 92 - Isolated Subclasses Names
Cover image for Code Smell 92 - Isolated Subclasses Names

Code Smell 92 - Isolated Subclasses Names

5
Comments
2 min read
Code Smell 93 - Send me Anything
Cover image for Code Smell 93 - Send me Anything

Code Smell 93 - Send me Anything

6
Comments 1
2 min read
Code Smell 94 - Too Many imports
Cover image for Code Smell 94 - Too Many imports

Code Smell 94 - Too Many imports

6
Comments
2 min read
Code Smell 95 - Premature Classification
Cover image for Code Smell 95 - Premature Classification

Code Smell 95 - Premature Classification

5
Comments
2 min read
Code Smell 96 - My Objects
Cover image for Code Smell 96 - My Objects

Code Smell 96 - My Objects

6
Comments
1 min read
Code Smell 97 - Error Messages Without Empathy
Cover image for Code Smell 97 - Error Messages Without Empathy

Code Smell 97 - Error Messages Without Empathy

6
Comments
1 min read
Code Smell 98 - Speling Mistakes
Cover image for Code Smell 98 - Speling Mistakes

Code Smell 98 - Speling Mistakes

5
Comments
1 min read
Code Smell 99 - First Second
Cover image for Code Smell 99 - First Second

Code Smell 99 - First Second

6
Comments
1 min read
Code Smell 100 - GoTo
Cover image for Code Smell 100 - GoTo

Code Smell 100 - GoTo

7
Comments
2 min read
Code Smell 101 - Comparison Against Booleans
Cover image for Code Smell 101 - Comparison Against Booleans

Code Smell 101 - Comparison Against Booleans

6
Comments
2 min read
Code Smell 102 - Arrow Code
Cover image for Code Smell 102 - Arrow Code

Code Smell 102 - Arrow Code

6
Comments
2 min read
Code Smell 103 - Double Encapsulation
Cover image for Code Smell 103 - Double Encapsulation

Code Smell 103 - Double Encapsulation

3
Comments
2 min read
Code Smell 104 - Assert True
Cover image for Code Smell 104 - Assert True

Code Smell 104 - Assert True

4
Comments
2 min read
Code Smell 105 - Comedian Methods
Cover image for Code Smell 105 - Comedian Methods

Code Smell 105 - Comedian Methods

2
Comments 4
2 min read
Code Smell 106 - Production Dependent Code
Cover image for Code Smell 106 - Production Dependent Code

Code Smell 106 - Production Dependent Code

1
Comments
2 min read
Code Smell 107 - Variables Reuse
Cover image for Code Smell 107 - Variables Reuse

Code Smell 107 - Variables Reuse

5
Comments 1
2 min read
Code Smell 108 - Float Assertions
Cover image for Code Smell 108 - Float Assertions

Code Smell 108 - Float Assertions

4
Comments
2 min read
Code Smell 109 - Automatic Properties
Cover image for Code Smell 109 - Automatic Properties

Code Smell 109 - Automatic Properties

6
Comments 6
2 min read
Code Smell 110 - Switches With Defaults
Cover image for Code Smell 110 - Switches With Defaults

Code Smell 110 - Switches With Defaults

7
Comments
2 min read
Code Smell 111 - Modifying Collections While Traversing
Cover image for Code Smell 111 - Modifying Collections While Traversing

Code Smell 111 - Modifying Collections While Traversing

6
Comments
2 min read
Code Smell 112 - Testing Private Methods
Cover image for Code Smell 112 - Testing Private Methods

Code Smell 112 - Testing Private Methods

5
Comments
2 min read
Code Smell 113 - Data Naming
Cover image for Code Smell 113 - Data Naming

Code Smell 113 - Data Naming

5
Comments
2 min read
Code Smell 114 - Empty Class
Cover image for Code Smell 114 - Empty Class

Code Smell 114 - Empty Class

6
Comments
2 min read
Code Smell 115 - Return True
Cover image for Code Smell 115 - Return True

Code Smell 115 - Return True

7
Comments 1
2 min read
Code Smell 116 - Variables Declared With 'var'
Cover image for Code Smell 116 - Variables Declared With 'var'

Code Smell 116 - Variables Declared With 'var'

6
Comments
2 min read
Code Smell 117 - Unrealistic Data
Cover image for Code Smell 117 - Unrealistic Data

Code Smell 117 - Unrealistic Data

4
Comments
3 min read
Code Smell 118 - Return False
Cover image for Code Smell 118 - Return False

Code Smell 118 - Return False

6
Comments 5
2 min read
Code Smell 119 - Stairs Code
Cover image for Code Smell 119 - Stairs Code

Code Smell 119 - Stairs Code

5
Comments
2 min read
Code Smell 120 - Sequential IDs
Cover image for Code Smell 120 - Sequential IDs

Code Smell 120 - Sequential IDs

6
Comments 2
2 min read
Code Smell 121 - String Validations
Cover image for Code Smell 121 - String Validations

Code Smell 121 - String Validations

6
Comments
3 min read
Code Smell 122 - Primitive Obsession
Cover image for Code Smell 122 - Primitive Obsession

Code Smell 122 - Primitive Obsession

11
Comments
2 min read
Code Smell 123 - Mixed 'What' and 'How'
Cover image for Code Smell 123 - Mixed 'What' and 'How'

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

7
Comments
2 min read
Code Smell 124 - Divergent Change
Cover image for Code Smell 124 - Divergent Change

Code Smell 124 - Divergent Change

6
Comments
2 min read
Code Smell 125 - 'IS-A' Relationship
Cover image for Code Smell 125 - 'IS-A' Relationship

Code Smell 125 - 'IS-A' Relationship

8
Comments 4
3 min read
Code Smell 126 - Fake Null Object
Cover image for Code Smell 126 - Fake Null Object

Code Smell 126 - Fake Null Object

11
Comments
3 min read
Code Smell 127 - Mutable Constants
Cover image for Code Smell 127 - Mutable Constants

Code Smell 127 - Mutable Constants

7
Comments
2 min read
Code Smell 128 - Non English Coding
Cover image for Code Smell 128 - Non English Coding

Code Smell 128 - Non English Coding

6
Comments 3
2 min read
Code Smell 129 - Structural Optimizations
Cover image for Code Smell 129 - Structural Optimizations

Code Smell 129 - Structural Optimizations

7
Comments
2 min read
Code Smell 130 - AddressImpl
Cover image for Code Smell 130 - AddressImpl

Code Smell 130 - AddressImpl

9
Comments
2 min read
Code Smell 131 - Zero Argument Constructor
Cover image for Code Smell 131 - Zero Argument Constructor

Code Smell 131 - Zero Argument Constructor

10
Comments
2 min read
Code Smell 132 - Exception Try Too Broad
Cover image for Code Smell 132 - Exception Try Too Broad