Class: Roodi::Checks::ModuleLineCountCheck

Inherits:
LineCountCheck show all
Defined in:
lib/roodi/checks/module_line_count_check.rb

Overview

Checks a module to make sure the number of lines it has is under the specified limit.

A module getting too large is a code smell that indicates it might be taking on too many responsibilities. It should probably be refactored into multiple smaller modules.

Constant Summary collapse

DEFAULT_LINE_COUNT =
300

Constants inherited from Check

Check::NODE_TYPES

Instance Method Summary collapse

Methods inherited from LineCountCheck

#evaluate_start, #interesting_nodes

Methods inherited from Check

#add_error, #end_file, #errors, #evaluate_end, #evaluate_node, #evaluate_node_end, #evaluate_node_start, #evaluate_start, #position, #start_file

Constructor Details

#initialize(options = {}) ⇒ ModuleLineCountCheck

Returns a new instance of ModuleLineCountCheck.



12
13
14
15
# File 'lib/roodi/checks/module_line_count_check.rb', line 12

def initialize(options = {})
  line_count = options['line_count'] || DEFAULT_LINE_COUNT
  super([:module], line_count, 'Module')
end