Module: RuboCop::Cop::MethodComplexity

Overview

This module handles measurement and reporting of complexity in methods.

Instance Method Summary collapse

Methods included from NodePattern::Macros

def_node_matcher, def_node_search, node_search, node_search_all, node_search_body, node_search_first

Instance Method Details

#on_block(node) ⇒ Object



15
16
17
18
19
# File 'lib/rubocop/cop/mixin/method_complexity.rb', line 15

def on_block(node)
  define_method?(node) do |name|
    check_complexity(node, name)
  end
end

#on_def(node) ⇒ Object Also known as: on_defs



10
11
12
# File 'lib/rubocop/cop/mixin/method_complexity.rb', line 10

def on_def(node)
  check_complexity(node, node.method_name)
end