You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The UtilityFunction smell could be misleading, e.g.
# Just for FunclassFunattr_accessor:arrdefbararr.eachdo |a_variable|
# This is an intermediate state, should not be communicated as# an instance variable, as reek suggestsb_variable=process(a_variable)putsb_variableendendprivatedefprocess(x_variable)x_variable + 1endend
reek fun.rb
=> fun.rb -- 1 warning:
=> [16]:Fun#process doesn't depend on instance state (UtilityFunction)
It is useful most of the time, but for method that process an intermediate state, create a instance variable is not the right way.