Functions with a long parameter list are difficult to use, as maintainers must figure out the role of each parameter and keep track of their position.
def modify(x1, y1, z1, x2, y2, z2) # Noncompliant # ... end
The solution can be to:
# Each function does a part of what the original distance function was doing, so confusion risks are lower def move(x, y, z) # ... end def resize(width, height, depth) # ... end
Point = Struct.new(:x, :y, :z) # In geometry, Point is a logical structure to group data def modify(p1, p2) # ... end
This rule raises an issue when a function has more parameters than the provided threshold.