Code Smell 94 — Too Many imports
If your class relies on too many others, it will be coupled and fragile. A long import list is a good indicator.
If your class relies on too many others, it will be coupled and fragile. A long import list is a good indicator.

TL;DR: Don’t import too much.
Problems
Coupling
Single Responsibility Principle violation
Low Cohesion
Solutions
1. Break the class
2. Hide intermediate accidental implementation
Sample Code
Wrong
Right
Detection
We can set a warning threshold on our linters.
Tags
Coupling
Ripple Effect
Conclusion
We need to think about dependencies when building our solutions to minimize Ripple Effect.
Relations
Code Smell 61 — Coupling to Classes
Classes are handy. We can call them and invoke them any time. Is this good?blog.devgenius.io
More Info
Coupling: The one and only software design problem
A root cause analysis of all failures of our software will find a single culprit with multiple costumes.codeburst.io
Credits
Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.
Alan Perlis
Software Engineering Great Quotes
Sometimes a short thought can bring amazing ideas.blog.devgenius.io
This article is part of the CodeSmell Series.
How to Find the Stinky parts of your Code
The code smells bad. Let’s see how to change the aromas.blog.devgenius.io