class Simplabs::Excellent::Checks::ClassLineCountCheck
This check reports classes which have more lines than the threshold. Classes with a large number of lines are hard to read and understand and often an indicator for badly designed code as well.
Applies to¶ ↑
-
classes
Constants
- DEFAULT_THRESHOLD
Public Instance Methods
evaluate(context)
click to toggle source
# File lib/simplabs/excellent/checks/class_line_count_check.rb, line 24 def evaluate(context) line_count = context.line_count == 1 ? 1 : context.line_count + 1 add_warning(*warning_args(context, line_count)) unless line_count <= @threshold end