class RuboCop::Cop::Metrics::MethodLength
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Constants
- LABEL
Public Instance Methods
on_block(node)
click to toggle source
# File lib/rubocop/cop/metrics/method_length.rb, line 22 def on_block(node) return unless node.send_node.method_name == :define_method check_code_length(node) end
on_def(node)
click to toggle source
# File lib/rubocop/cop/metrics/method_length.rb, line 14 def on_def(node) excluded_methods = cop_config['ExcludedMethods'] return if excluded_methods.include?(String(node.method_name)) check_code_length(node) end
Also aliased as: on_defs
Private Instance Methods
cop_label()
click to toggle source
# File lib/rubocop/cop/metrics/method_length.rb, line 30 def cop_label LABEL end