class RuboCop::Cop::Metrics::MethodLength
end # 5 points
HEREDOC
content.
Heredoc
<<~HEREDOC # +1
}
key: ‘value’
hash = { # +3
]
2
1,
array = [ # +1
def m
@example CountAsOne: [‘array’, ‘heredoc’]
for backwards compatibility. Please use ‘IgnoredMethods` instead.
NOTE: The `ExcludedMethods` configuration is deprecated and only kept
will be counted as one line regardless of its actual size.
Available are: ’array’, ‘hash’, and ‘heredoc’. Each literal
You can set literals you want to fold with ‘CountAsOne`.
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?(:define_method) check_code_length(node) end
def on_def(node)
def on_def(node) return if ignored_method?(node.method_name) check_code_length(node) end