Module: RuboCop::Cop::MethodComplexity
- Extended by:
- NodePattern::Macros
- Includes:
- ConfigurableMax
- Included in:
- RuboCop::Cop::Metrics::AbcSize, RuboCop::Cop::Metrics::CyclomaticComplexity, RuboCop::Cop::Metrics::PerceivedComplexity
- Defined in:
- lib/rubocop/cop/mixin/method_complexity.rb
Overview
This module handles measurement and reporting of complexity in methods.
Instance Method Summary collapse
- #on_block(node) ⇒ Object
- #on_def(node) ⇒ Object (also: #on_defs)
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 |