class RuboCop::Cop::Style::MethodLength
The maximum allowed length is configurable.
Comment lines can optionally be ignored.
This cop checks if the length a method exceeds some maximum value.
def code_length(node)
def code_length(node) lines = node.loc.expression.source.lines.to_a[1..-2] || [] lines.reject! { |line| irrelevant_line(line) } lines.size end
def message
def message 'Method has too many lines. [%d/%d]' end