class RuboCop::Cop::Metrics::BlockLength

The cop can be configured to ignore blocks passed to certain methods.
The maximum allowed length is configurable.
Comment lines can optionally be ignored.
This cop checks if the length of a block exceeds some maximum value.

def cop_label

def cop_label
  LABEL
end

def excluded_methods

def excluded_methods
  cop_config['ExcludedMethods'] || []
end

def on_block(node)

def on_block(node)
  return if excluded_methods.include?(node.method_name.to_s)
  check_code_length(node)
end