troessner / reek

Code smell detector for Ruby
https://github.com/troessner/reek
MIT License
4.05k stars 280 forks source link

FeatureEnvy and small methods #1535

Open mvz opened 4 years ago

mvz commented 4 years ago

I'm really beginning to dislike the FeatureEnvy detector for small methods:

def common_parameters_equal?(other_parameters)
  smell_warning.parameters.values_at(*other_parameters.keys) == other_parameters.values
end

Should we make this less strict? Require a larger difference? More statements? WDYT?

troessner commented 4 years ago

I would be perfectly fine with making it less strict. Maybe everything less than 3 statements is fine?

replaid commented 3 years ago

I just came here to suggest giving a tolerance option—e.g. tolerance of 1 would allow 1 more reference to another "envious receiver" than to self. Could default to 0 for current hard-coded behavior.