Skip to content

False positive for DuplicateMethodCall with case statement #1493

@gettalong

Description

@gettalong

Given the following code:

def method
  case x
  when :a
    if y.method || a.method
    end
  when :b
    if y.method || b.method
    end
  end
end

reek reports a DuplicateMethodCall for y.method.

Yes, y.method appears two times in this method, however, it is only called at most once. Therefore I think that this is a false positive.

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