Sha256: 183ec8a6ebca8759eb31748ecc7d46c35f1f8ef21e0b3b044bab1e1dfcccbcb9

Contents?: true

Size: 661 Bytes

Versions: 13

Compression:

Stored size: 661 Bytes

Contents

require 'roodi/checks/line_count_check'

module Roodi
  module Checks
    # Checks a method to make sure the number of lines it has is under the specified limit.
    # 
    # A method getting too large is a code smell that indicates it might be doing more than one 
    # thing and becoming hard to test.  It should probably be refactored into multiple methods 
    # that each do a single thing well. 
    class MethodLineCountCheck < LineCountCheck
      DEFAULT_LINE_COUNT = 20
      
      def initialize(options = {})
        line_count = options['line_count'] || DEFAULT_LINE_COUNT
        super([:defn], line_count, 'Method')
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
threedaymonk-roodi-1.3.8 lib/roodi/checks/method_line_count_check.rb
roodi1.9-2.0.1 lib/roodi/checks/method_line_count_check.rb
roodi-2.1.0 lib/roodi/checks/method_line_count_check.rb
roodi-2.0.1 lib/roodi/checks/method_line_count_check.rb
roodi-2.0.0 lib/roodi/checks/method_line_count_check.rb
roodi-1.3.4 lib/roodi/checks/method_line_count_check.rb
roodi-1.3.0 lib/roodi/checks/method_line_count_check.rb
roodi-1.3.6 lib/roodi/checks/method_line_count_check.rb
roodi-1.3.5 lib/roodi/checks/method_line_count_check.rb
roodi-1.3.7 lib/roodi/checks/method_line_count_check.rb
roodi-1.3.3 lib/roodi/checks/method_line_count_check.rb
roodi-1.3.2 lib/roodi/checks/method_line_count_check.rb
roodi-1.4.0 lib/roodi/checks/method_line_count_check.rb