Ruby

Ruby

Made by DeepSource

Ambiguous operators in first arg of method invocation RB-LI1002

Bug risk
Major
Autofix

Params to the method are passed without parentheses. Presence of some operators, like +, -, *, ** and &, make the method invocation look ambiguous.

Bad practice

# the code is interpreted as invoking method f with a positive number a,
# but it could also appear as addition to a reader
f +a

Recommended

# With parentheses, there's no ambiguity.
f(+a)