class RuboCop::Cop::Metrics::MethodLength

The maximum allowed length is configurable.
Comment lines can optionally be ignored.
This cop checks if the length of a method exceeds some maximum value.

def cop_label

def cop_label
  LABEL
end

def on_block(node)

def on_block(node)
  return unless node.send_node.method_name == :define_method
  check_code_length(node)
end

def on_def(node)

def on_def(node)
  excluded_methods = cop_config['ExcludedMethods']
  return if excluded_methods.include?(String(node.method_name))
  check_code_length(node)
end