Class: Simplabs::Excellent::Checks::MethodLineCountCheck

Inherits:
LineCountCheck show all
Defined in:
lib/simplabs/excellent/checks/method_line_count_check.rb

Overview

This check reports methods which have more lines than the threshold. Methods with a large number of lines are hard to read and understand and often an indicator for badly designed code as well.

Applies to

  • methods

Constant Summary collapse

DEFAULT_THRESHOLD =
20

Instance Attribute Summary

Attributes inherited from Base

#interesting_files, #interesting_nodes, #warnings

Instance Method Summary collapse

Methods inherited from LineCountCheck

#evaluate

Methods inherited from Base

#add_warning, #evaluate_node, #warnings_for

Constructor Details

#initialize(options = {}) ⇒ MethodLineCountCheck

:nodoc:



19
20
21
22
# File 'lib/simplabs/excellent/checks/method_line_count_check.rb', line 19

def initialize(options = {}) #:nodoc:
  threshold = options[:threshold] || DEFAULT_THRESHOLD
  super([:defn], threshold)
end