Module: RuboCop::Cop::MethodComplexity Private

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

This module handles measurement and reporting of complexity in methods.

Instance Method Summary collapse

Methods included from ExcludeLimit

exclude_limit

Methods included from RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount

#discount_for_repeated_csend?, #reset_on_lvasgn, #reset_repeated_csend

Instance Method Details

#on_block(node) ⇒ Object Also known as: on_numblock

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
# File 'lib/rubocop/cop/mixin/method_complexity.rb', line 24

def on_block(node)
  define_method?(node) do |name|
    return if allowed_method?(name) || matches_allowed_pattern?(name)

    check_complexity(node, name)
  end
end

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def on_def(node)
  return if allowed_method?(node.method_name) || matches_allowed_pattern?(node.method_name)

  check_complexity(node, node.method_name)
end