reek
reek copied to clipboard
False positive of UtilityFunction for class methods
Hi there
I've observed a false positive for UtilityFunction when class methods are defined under class_methods
block of ActiveSupport::Concern
For instance
module SomeModule
extend ActiveSupport::Concern
class_methods do
def some_method(arg1, arg2)
return 1 if arg1.something?
return 2 if arg2.something_else?
3
end
end
end
So here I'm getting UtilityFunction
warning, but it makes no sense, and by definition it wouldn't warn this method was defined using self.
Thanks in advance
Reproduced in version 'reek', '~> 6.0'
and the warning still occurs.
Can I open a PR to fix the issue?
@mateusluizfb yes, please. Let me know if you need any pointers.
@mvz PR here https://github.com/troessner/reek/pull/1596 :)