module RuboCop::Cop::Metrics::Utils::RepeatedAttributeDiscount

def find_attributes(node, &block)

then `nil` is yielded
If the node is not a series of `(c)send` calls with no arguments,
associated key (method_name)
If at any step the subdirectory does not exist, it is yielded with the
Returns the "known_attributes" for the `node` by walking the receiver tree
def find_attributes(node, &block)
  if attribute_call?(node)
    calls = find_attributes(node.receiver, &block)
    value = node.method_name
  elsif root_node?(node)
    calls = @known_attributes
    value = node
  else
    return yield nil
  end
  calls.fetch(value) { yield [calls, value] }
end