Class: Rubocop::Cop::MethodLength

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/method_length.rb

Constant Summary collapse

MSG =
'Method has too many lines. [%d/%d]'

Instance Attribute Summary

Attributes inherited from Cop

#debug, #disabled_lines, #offences

Instance Method Summary collapse

Methods inherited from Cop

#add_offence, cop_name, #has_report?, #ignore_node, inherited, #initialize, #inspect, #name, #on_comment

Constructor Details

This class inherits a constructor from Rubocop::Cop::Cop

Instance Method Details

#count_comments?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/rubocop/cop/method_length.rb', line 24

def count_comments?
  MethodLength.config['CountComments']
end

#max_lengthObject



20
21
22
# File 'lib/rubocop/cop/method_length.rb', line 20

def max_length
  MethodLength.config['Max']
end

#on_def(node) ⇒ Object



8
9
10
11
12
# File 'lib/rubocop/cop/method_length.rb', line 8

def on_def(node)
  check(node)

  super
end

#on_defs(node) ⇒ Object



14
15
16
17
18
# File 'lib/rubocop/cop/method_length.rb', line 14

def on_defs(node)
  check(node)

  super
end