Module: RuboCop::Cop::MethodComplexity
- Extended by:
- NodePattern::Macros
- Includes:
- ConfigurableMax, IgnoredMethods
- 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
18 19 20 21 22 23 24 |
# File 'lib/rubocop/cop/mixin/method_complexity.rb', line 18 def on_block(node) define_method?(node) do |name| return if ignored_method?(name) check_complexity(node, name) end end |
#on_def(node) ⇒ Object Also known as: on_defs
11 12 13 14 15 |
# File 'lib/rubocop/cop/mixin/method_complexity.rb', line 11 def on_def(node) return if ignored_method?(node.method_name) check_complexity(node, node.method_name) end |