Class: Roodi::Checks::ClassLineCountCheck
- Inherits:
-
LineCountCheck
- Object
- Check
- LineCountCheck
- Roodi::Checks::ClassLineCountCheck
- Defined in:
- lib/roodi/checks/class_line_count_check.rb
Overview
Checks a class to make sure the number of lines it has is under the specified limit.
A class 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 classes.
Constant Summary collapse
- DEFAULT_LINE_COUNT =
300
Constants inherited from Check
Roodi::Checks::Check::NODE_TYPES
Instance Attribute Summary
Attributes inherited from LineCountCheck
Instance Method Summary collapse
-
#initialize ⇒ ClassLineCountCheck
constructor
A new instance of ClassLineCountCheck.
- #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 ⇒ ClassLineCountCheck
Returns a new instance of ClassLineCountCheck.
13 14 15 16 |
# File 'lib/roodi/checks/class_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/class_line_count_check.rb', line 18 def interesting_nodes [:class] end |
#message_prefix ⇒ Object
22 23 24 |
# File 'lib/roodi/checks/class_line_count_check.rb', line 22 def 'Class' end |