How to Find the Stinky parts of your Code
Tags: codenewbie, tutorial, codequality, beginners
Published: 2021-05-21 00:26:37

> 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

{% post https://dev.to/mcsee/code-smell-01-anemic-models-4dg2 %}

{% post https://dev.to/mcsee/code-smell-02-constants-and-magic-numbers-obb %}

{% post https://dev.to/mcsee/code-smell-149-optional-chaining-jk %}

{% post https://dev.to/mcsee/code-smell-04-string-abusers-1nma %}

{% post https://dev.to/mcsee/code-smell-05-comment-abusers-2ba5 %}

{% post https://dev.to/mcsee/code-smell-06-too-clever-programmer-37lb %}

{% post https://dev.to/mcsee/code-smell-07-boolean-variables-3koj %}

{% post https://dev.to/mcsee/code-smell-08-long-chains-of-collaborations-30c3 %}

{% post https://dev.to/mcsee/code-smell-09-dead-code-3ig2 %}

{% post https://dev.to/mcsee/code-smell-10-too-many-arguments-4o67 %}

{% post https://dev.to/mcsee/code-smell-11-subclassification-for-code-reuse-1136 %}

{% post https://dev.to/mcsee/code-smell-12-null-la4 %}

{% post https://dev.to/mcsee/code-smell-13-empty-constructors-4i4o %}

{% post https://dev.to/mcsee/code-smell-14-god-objects-5185 %}

{% post https://dev.to/mcsee/code-smell-15-missed-preconditions-7c3 %}

{% post https://dev.to/mcsee/code-smell-16-ripple-effect-3881 %}

{% post https://dev.to/mcsee/code-smell-17-global-functions-4b82 %}

{% post https://dev.to/mcsee/code-smell-18-static-functions-fpj %}

{% post https://dev.to/mcsee/code-smell-19-optional-arguments-48gc %}

{% post https://dev.to/mcsee/code-smell-20-premature-optimization-4moe %}

{% post https://dev.to/mcsee/code-smell-21-anonymous-functions-abusers-47f5 %}

{% post https://dev.to/mcsee/code-smell-22-helpers-2j6j %}

{% post https://dev.to/mcsee/code-smell-23-instance-type-checking-1i90 %}

{% post https://dev.to/mcsee/code-smell-24-boolean-coercions-25l4 %}

{% post https://dev.to/mcsee/code-smell-25-pattern-abusers-2dgi %}

{% post https://dev.to/mcsee/code-smell-26-exceptions-polluting-pbn %}

{% post https://dev.to/mcsee/code-smell-27-associative-arrays-2n7j %}

{% post https://dev.to/mcsee/code-smell-28-setters-2hih %}

{% post https://dev.to/mcsee/code-smell-29-settings-configs-3eh3 %}

{% post https://dev.to/mcsee/code-smell-30-mocking-business-3glm %}

{% post https://dev.to/mcsee/code-smell-31-accidental-methods-on-business-objects-gpm %}

{% post https://dev.to/mcsee/code-smell-32-singletons-1ka %}

{% post https://dev.to/mcsee/code-smell-33-abbreviations-356o %}

{% post https://dev.to/mcsee/code-smell-34-too-many-attributes-584p %}

{% post https://dev.to/mcsee/code-smell-35-state-as-properties-4kbn %}

{% post https://dev.to/mcsee/code-smell-36-switch-case-elseif-else-if-statements-h6c %}

{% post https://dev.to/mcsee/code-smell-37-protected-attributes-4n4 %}

{% post https://dev.to/mcsee/code-smell-38-abstract-names-34ng %}

{% post https://dev.to/mcsee/code-smell-39-new-date-75g %}

{% post https://dev.to/mcsee/code-smell-40-dtos-4426 %}

{% post https://dev.to/mcsee/code-smell-41-regular-expression-abusers-5gn0 %}

{% post https://dev.to/mcsee/code-smell-42-warnings-strict-mode-off-c4d %}

{% post https://dev.to/mcsee/code-smell-43-concrete-classes-subclassified-40fp %}

{% post https://dev.to/mcsee/code-smell-44-magic-corrections-4dpl %}

{% post https://dev.to/mcsee/code-smell-45-not-polymorphic-388g %}

{% post https://dev.to/mcsee/code-smell-46-repeated-code-4iib %}

{% post https://dev.to/mcsee/code-smell-47-diagrams-3ho7 %}

{% post https://dev.to/mcsee/code-smell-48-code-without-standards-2f5m %}

{% post https://dev.to/mcsee/code-smell-49-caches-2734 %}

{% post https://dev.to/mcsee/code-smell-50-object-keys-2bd6 %}

{% post https://dev.to/mcsee/code-smell-51-double-negatives-4fh0 %}

{% post https://dev.to/mcsee/code-smell-52-fragile-tests-18o6 %}

{% post https://dev.to/mcsee/code-smell-53-explicit-iteration-40hl %}

{% post https://dev.to/mcsee/code-smell-54-anchor-boats-5g25 %}

{% post https://dev.to/mcsee/code-smell-55-object-orgy-3go %}

{% post https://dev.to/mcsee/code-smell-56-preprocessors-4hf9 %}

{% post https://dev.to/mcsee/code-smell-57-versioned-functions-1f5o %}

{% post https://dev.to/mcsee/code-smell-58-yo-yo-problem-ej9 %}

{% post https://dev.to/mcsee/code-smell-59-basic-do-functions-2a86 %}

{% post https://dev.to/mcsee/code-smell-60-global-classes-3o9m %}

{% post https://dev.to/mcsee/code-smell-61-coupling-to-classes-3jdk %}

{% post https://dev.to/mcsee/code-smell-62-flag-variables-1a9p %}

{% post https://dev.to/mcsee/code-smell-63-feature-envy-502f %}

{% post https://dev.to/mcsee/code-smell-64-inappropriate-intimacy-5h55 %}

{% post https://dev.to/mcsee/code-smell-65-variables-named-after-types-9da %}

{% post https://dev.to/mcsee/code-smell-66-shotgun-surgery-1hpd %}

{% post https://dev.to/mcsee/code-smell-67-middle-man-cn3 %}

{% post https://dev.to/mcsee/code-smell-68-getters-o12 %}

{% post https://dev.to/mcsee/code-smell-69-big-bang-javascript-ridiculous-castings-49ij %}

{% post https://dev.to/mcsee/code-smell-70-anemic-model-generators-1jpl %}

{% post https://dev.to/mcsee/code-smell-71-magic-floats-disguised-as-decimals-2g7p %}

{% post https://dev.to/mcsee/code-smell-72-return-codes-19p7 %} 

{% post https://dev.to/mcsee/code-smell-73-exceptions-for-expected-cases-504c %}

{% post https://dev.to/mcsee/code-smell-74-empty-lines-467h %}

{% post https://dev.to/mcsee/code-smell-75-comments-inside-a-method-2bk %}

{% post https://dev.to/mcsee/code-smell-76-generic-assertions-31f1 %}

{% post https://dev.to/mcsee/code-smell-77-timestamps-odm %}

{% post https://dev.to/mcsee/code-smell-78-callback-hell-287f %}

{% post https://dev.to/mcsee/code-smell-79-theresult-429k %}

{% post https://dev.to/mcsee/code-smell-80-nested-try-catch-3o5c %}

{% post https://dev.to/mcsee/code-smell-81-result-45ko %}

{% post https://dev.to/mcsee/code-smell-82-tests-violating-encapsulation-11je %}

{% post https://dev.to/mcsee/code-smell-83-variables-reassignment-jg %}

{% post https://dev.to/mcsee/code-smell-84-max-min-javascript-d39 %}

{% post https://dev.to/mcsee/code-smell-85-and-functions-3h21 %}

{% post https://dev.to/mcsee/code-smell-86-mutable-const-arrays-46ag %}

{% post https://dev.to/mcsee/code-smell-87-inconsistent-parameters-sorting-21j3 %}

{% post https://dev.to/mcsee/code-smell-87-inconsistent-parameters-sorting-21j3 %}

{% post https://dev.to/mcsee/code-smell-89-math-feature-envy-5543 %}

{% post https://dev.to/mcsee/code-smell-90-implementative-callback-events-13l %}

{% post https://dev.to/mcsee/code-smell-91-test-asserts-without-description-4im4 %}

{% post https://dev.to/mcsee/code-smell-92-isolated-subclasses-names-3i84 %}

{% post https://dev.to/mcsee/code-smell-93-send-me-anything-16m3 %}

{% post https://dev.to/mcsee/code-smell-90-implementative-callback-events-13l %}

{% post https://dev.to/mcsee/code-smell-95-premature-classification-14ha %}

{% post https://dev.to/mcsee/code-smell-96-my-objects-5cij %}

{% post https://dev.to/mcsee/code-smell-97-error-messages-without-empathy-4lpo %}

{% post https://dev.to/mcsee/code-smell-98-speling-mistakes-4h4e %}

{% post https://dev.to/mcsee/code-smell-99-first-second-j47 %}

{% post https://dev.to/mcsee/code-smell-100-goto-b3a %}

{% post https://dev.to/mcsee/code-smell-101-comparison-against-booleans-3aic %}

{% post https://dev.to/mcsee/code-smell-102-arrow-code-4kfk %}

{% post https://dev.to/mcsee/code-smell-103-double-encapsulation-4jmf %}

{% post https://dev.to/mcsee/code-smell-104-assert-true-20db %}

{% post https://dev.to/mcsee/code-smell-105-comedian-methods-55h0 %}

{% post https://dev.to/mcsee/code-smell-106-production-dependent-code-3f47 %}

{% post https://dev.to/mcsee/code-smell-107-variables-reuse-3m53 %}

{% post https://dev.to/mcsee/code-smell-108-float-assertions-40b5 %}

{% post https://dev.to/mcsee/code-smell-109-automatic-properties-f40 %}

{% post https://dev.to/mcsee/code-smell-110-switches-with-defaults-1ibb %}

{% post https://dev.to/mcsee/code-smell-111-modifying-collections-while-traversing-5aac %}

{% post https://dev.to/mcsee/code-smell-112-testing-private-methods-1gm8 %}

{% post https://dev.to/mcsee/code-smell-113-data-naming-1bm9 %}

{% post https://dev.to/mcsee/code-smell-114-empty-class-4khg %}

{% post https://dev.to/mcsee/code-smell-115-return-true-3gn4 %}

{% post https://dev.to/mcsee/code-smell-116-variables-declared-with-var-5mj %}

{% post https://dev.to/mcsee/code-smell-117-unrealistic-data-3pl4 %}

{% post https://dev.to/mcsee/code-smell-118-return-false-569p %}

{% post https://dev.to/mcsee/code-smell-119-stairs-code-1e2b %}

{% post https://dev.to/mcsee/code-smell-120-sequential-ids-egm %}

{% post https://dev.to/mcsee/code-smell-121-string-validations-38ph %}

{% post https://dev.to/mcsee/code-smell-122-primitive-obsession-4a55 %}

{% post https://dev.to/mcsee/code-smell-123-mixed-what-and-how-4bak %}

{% post https://dev.to/mcsee/code-smell-124-divergent-change-ddl %}

{% post https://dev.to/mcsee/code-smell-125-is-a-relationship-46f4 %}

{% post https://dev.to/mcsee/code-smell-126-fake-null-object-508 %}

{% post https://dev.to/mcsee/code-smell-127-mutable-constants-26dj %}

{% post https://dev.to/mcsee/-code-smell-128-non-english-coding-48d8 %}

{% post https://dev.to/mcsee/code-smell-129-structural-optimizations-3l62 %}

{% post https://dev.to/mcsee/code-smell-130-addressimpl-b46 %}

{% post https://dev.to/mcsee/code-smell-131-zero-argument-constructor-1ee0 %}

{% post https://dev.to/mcsee/code-smell-132-exception-try-too-broad-3f8n %}

{% post https://dev.to/mcsee/code-smell-133-hardcoded-if-conditions-53bi %}

{% post https://dev.to/mcsee/code-smell-134-specialized-business-collections-2bm8 %}

{% post https://dev.to/mcsee/code-smell-135-interfaces-with-just-one-realization-4nen %}

{% post https://dev.to/mcsee/code-smell-136-classes-with-just-one-subclass-1h18 %}

{% post https://dev.to/mcsee/code-smell-137-inheritance-tree-too-deep-3j5p %}

{% post https://dev.to/mcsee/code-smell-138-packages-dependency-36d8 %}

{% post https://dev.to/mcsee/code-smell-139-business-code-in-the-user-interface-1i4o %}

{% post https://dev.to/mcsee/code-smell-140-short-circuit-evaluation-20kc %}

{% post https://dev.to/mcsee/code-smell-141-iengine-avehicle-implcar-58ch %}

{% post https://dev.to/mcsee/code-smell-142-queries-in-constructors-37f8 %}

{% post https://dev.to/mcsee/code-smell-143-data-clumps-52f6 %}

{% post https://dev.to/mcsee/code-smell-144-fungible-objects-3h87 %}

{% post https://dev.to/mcsee/code-smell-145-short-circuit-hack-4l4p %}

{% post https://dev.to/mcsee/code-smell-146-getter-comments-3pjn %}

{% post https://dev.to/mcsee/code-smell-147-too-many-methods-4ech %}

{% post https://dev.to/mcsee/code-smell-148-todos-5gn9 %}

{% post https://dev.to/mcsee/code-smell-149-optional-chaining-jk %}

{% post https://dev.to/mcsee/code-smell-150-equal-comparison-ok1 %}

{% post https://dev.to/mcsee/code-smell-151-commented-code-5d8l %}

{% post https://dev.to/mcsee/code-smell-152-logical-comment-2bg0 %}

{% post https://dev.to/mcsee/code-smell-153-too-long-names-381f %}

{% post https://dev.to/mcsee/code-smell-154-too-many-variables-4h6h %}

{% post https://dev.to/mcsee/code-smell-155-multiple-promises-5ed4 %}

{% post https://dev.to/mcsee/code-smell-156-implicit-else-1ko3 %}

{% post https://dev.to/mcsee/code-smell-157-balance-at-0-3695 %}

{% post https://dev.to/mcsee/code-smell-158-variables-not-variable-39ke %}

{% post https://dev.to/mcsee/code-smell-159-mixedcase-nc %}

{% post https://dev.to/mcsee/code-smell-160-invalid-id-9999-1b70 %}

{% post https://dev.to/mcsee/code-smell-161-abstractfinalundefined-classes-70c %}

{% post https://dev.to/mcsee/code-smell-162-too-many-parentheses-76b %}

{% post https://dev.to/mcsee/code-smell-163-collection-in-name-2gif %}

{% post https://dev.to/mcsee/code-smell-164-mixed-indentations-3gfc %}

{% post https://dev.to/mcsee/code-smell-165-empty-exception-blocks-27bg %}

{% post https://dev.to/mcsee/code-smell-166-low-level-errors-on-user-interface-4iid %}

{% post https://dev.to/mcsee/code-smell-167-hashing-comparison-3c4g %}

{% post https://dev.to/mcsee/code-smell-168-undocumented-decisions-1nci %}

{% post https://dev.to/mcsee/code-smell-169-glued-methods-2h8l %} 

{% post https://dev.to/mcsee/code-smell-170-refactor-with-functional-changes-4e13 %} 

{% post https://dev.to/mcsee/code-smell-171-plural-classes-3d0i %} 

{% post https://dev.to/mcsee/code-smell-172-default-argument-values-not-last-1al7 %} 

{% post https://dev.to/mcsee/code-smell-174-broken-windows-50am %} 

{% post https://dev.to/mcsee/code-smell-174-class-name-in-attributes-55c %} 

{% post https://dev.to/mcsee/code-smell-175-changes-without-coverage-120i %} 

{% post https://dev.to/mcsee/code-smell-176-changes-in-essence-5265 %} 

{% post https://dev.to/mcsee/code-smell-177-missing-small-objects-h2j %} 

{% post https://dev.to/mcsee/code-smell-178-subsets-violation-1fkc %} 

{% post https://dev.to/mcsee/code-smell-179-known-bugs-1ieg %} 

{% post https://dev.to/mcsee/code-smell-180-bitwise-optimizations-2072 %} 

{% post https://dev.to/mcsee/code-smell-181-nested-classes-3k6h %} 

{% post https://dev.to/mcsee/code-smell-182-over-generalization-2a9k %} 

{% post https://dev.to/mcsee/code-smell-183-obsolete-comments-3mmo %} 

{% post https://dev.to/mcsee/code-smell-184-exception-arrow-code-2cia %} 

{% post https://dev.to/mcsee/code-smell-185-evil-regular-expressions-47ko %} 

{% post https://dev.to/mcsee/code-smell-186-hardcoded-business-conditions-3m5h %} 

{% post https://dev.to/mcsee/eng8i-llws-poo-sprawkoaq-sl3i-1e0i %} 

{% post https://dev.to/mcsee/code-smell-188-redundant-parameter-names-8cf %} 

{% post https://dev.to/mcsee/code-smell-189-not-sanitized-input-853 %} 

{% post https://dev.to/mcsee/code-smell-190-unnecessary-properties-2an8 %}

{% post https://dev.to/mcsee/code-smell-191-misplaced-responsibility-53ik %}

{% post https://dev.to/mcsee/code-smell-192-optional-attributes-263m %}

{% post https://dev.to/mcsee/code-smell-193-switch-instead-of-formula-adl %}

{% post https://dev.to/mcsee/code-smell-194-missing-interval-4ala %}

{% post https://dev.to/mcsee/code-smell-195-yoda-conditions-1mgl %}

{% post https://dev.to/mcsee/code-smell-196-javascript-array-constructors-4cl5 %}

{% post https://dev.to/mcsee/code-smell-197-gratuitous-context-4gk %}

{% post https://dev.to/mcsee/code-smell-198-hidden-assumptions-32i3 %}

{% post https://dev.to/mcsee/code-smell-199-gratuitous-booleans-2c98 %}

{% post https://dev.to/mcsee/code-smell-200-poltergeist-4k6 %}

{% post https://dev.to/mcsee/code-smell-201-nested-ternaries-4mof %}

{% post https://dev.to/mcsee/code-smell-202-god-constant-class-36jk %}

{% post https://dev.to/mcsee/code-smell-203-irrelevant-test-information-3e1h %}

{% post https://dev.to/mcsee/code-smell-204-tests-depending-on-dates-4o8j %}

{% post https://dev.to/mcsee/code-smell-205-code-in-destructors-2eli %}

{% post https://dev.to/mcsee/code-smell-206-long-ternaries-2fk %}

{% post https://dev.to/mcsee/code-smell-207-dynamic-methods-4a1g %}

{% post https://dev.to/mcsee/code-smell-208-null-island-45dl %}

{% post https://dev.to/mcsee/code-smell-209-side-effects-13l8 %}

{% post https://dev.to/mcsee/code-smell-210-dynamic-properties-j2g %}

{% post https://dev.to/mcsee/code-smell-211-tab-over-spaces-1d41 %}

{% post https://dev.to/mcsee/code-smell-212-elvis-operator-4pap %}

{% post https://dev.to/mcsee/code-smell-213-hoisting-40lp %}

{% post https://dev.to/mcsee/code-smell-214-duplicate-parameter-names-4a81 %}

{% post https://dev.to/mcsee/code-smell-215-deserializing-object-vulnerability-3hbj %}

{% post https://dev.to/mcsee/code-smell-216-fat-interface-3jlp %}

{% post https://dev.to/mcsee/code-smell-217-empty-implementation-5fpg %}

{% post https://dev.to/mcsee/code-smell-218-magic-concatenation-1cem %}

{% post https://dev.to/mcsee/code-smell-219-looping-from-index-0-4ncn %}

{% post https://dev.to/mcsee/code-smell-220-return-tuple-306j %}

{% post https://dev.to/mcsee/code-smell-221-missing-break-in-switch-3b44 %}

{% post https://dev.to/mcsee/code-smell-222-comma-operator-3pi5 %}

{% post https://dev.to/mcsee/code-smell-223-racial-naming-1n16 %}

{% post https://dev.to/mcsee/code-smell-224-deodorant-comments-3nfk %}

{% post https://dev.to/mcsee/code-smell-225-pass-by-reference-9n0 %}

{% post https://dev.to/mcsee/code-smell-226-mixed-priorities-4ma1 %}

{% post https://dev.to/mcsee/code-smell-227-cowboy-coding-38kb %}

{% post https://dev.to/mcsee/code-smell-228-multiple-classes-per-file-4l1a %}

{% post https://dev.to/mcsee/code-smell-229-red-tape-44c2 %}

{% post https://dev.to/mcsee/code-smell-230-schrodinger-code-4opn %}

{% post https://dev.to/mcsee/code-smell-231-redundant-data-237d %}

{% post https://dev.to/mcsee/code-smell-232-reusable-code-44p5 %}

{% post https://dev.to/mcsee/code-smell-233-collections-count-o45 %}

{% post https://dev.to/mcsee/code-smell-234-long-circuit-5l1 %}
  

... and many more to come.

* * *

![Aroma](https://cdn.hashnode.com/res/hashnode/image/upload/v1603577138164/btRuwlKSA.jpeg)

Photo by [Richárd Ecsedi](https://unsplash.com/@icsike2) on [Unsplash](https://unsplash.com/@icsike2)

* * *

> Smells are certain structures in the code that suggest (sometimes they scream for) the possibility of refactoring

_Martin Fowler_

{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

Part of the objective of this series of articles is to generate spaces for debate and discussion on software design.

{% post https://dev.to/mcsee/object-design-checklist-2p4 %}

We look forward to your comments and suggestions on this article.

Original Thread on [Twitter](https://twitter.com/mcsee1/status/1297685140995551233)