Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive of UtilityFunction for class methods #1538

Open
VladYermakov opened this issue May 15, 2020 · 3 comments
Open

False positive of UtilityFunction for class methods #1538

VladYermakov opened this issue May 15, 2020 · 3 comments

Comments

@VladYermakov
Copy link

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

@mateusluizfb
Copy link

Reproduced in version 'reek', '~> 6.0' and the warning still occurs.

Can I open a PR to fix the issue?

@mvz
Copy link
Collaborator

mvz commented Mar 29, 2021

@mateusluizfb yes, please. Let me know if you need any pointers.

@mateusluizfb
Copy link

@mvz PR here #1596 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants