Class: Roodi::Checks::ModuleLineCountCheck
- Inherits:
-
LineCountCheck
- Object
- Check
- LineCountCheck
- Roodi::Checks::ModuleLineCountCheck
- 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
Instance Attribute Summary
Attributes inherited from LineCountCheck
Instance Method Summary collapse
-
#initialize ⇒ ModuleLineCountCheck
constructor
A new instance of ModuleLineCountCheck.
- #interesting_nodes ⇒ Object
- #message_prefix ⇒ Object
Methods inherited from LineCountCheck
Methods inherited from Check
#add_error, #end_file, #errors, #evaluate_end, #evaluate_node, #evaluate_node_end, #evaluate_node_start, #evaluate_start, make, #position, #start_file
Constructor Details
#initialize ⇒ ModuleLineCountCheck
Returns a new instance of ModuleLineCountCheck.
13 14 15 16 |
# File 'lib/roodi/checks/module_line_count_check.rb', line 13 def initialize super() self.line_count = DEFAULT_LINE_COUNT end |
Instance Method Details
#interesting_nodes ⇒ Object
18 19 20 |
# File 'lib/roodi/checks/module_line_count_check.rb', line 18 def interesting_nodes [:module] end |
#message_prefix ⇒ Object
22 23 24 |
# File 'lib/roodi/checks/module_line_count_check.rb', line 22 def 'Module' end |