Skip to content

False positive of UtilityFunction for class methods #1538

@VladYermakov

Description

@VladYermakov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions