Code Smell 10 - Too Many Arguments
29 September, 2022
6
6
0
Contributors
TL;DR: Don't pass more than three arguments to your functions.
Problems
•
Low maintainability
•
Low Reuse
•
Coupling
Solutions
•
Find cohesive relations among arguments
•
Create a "context".
•
Consider using a Method Object Pattern.
•
Avoid "basic" Types: strings, arrays, integers, etc. Think on objects.
Sample Code
Wrong
Right
Detection
Exceptions
•
Tags
•
Conclusion
Relations
Credits
programming
refactoring
code
cleancode
smells