Sha256: b422b5561c61816542a4fa2537d14cf9e9cd67403124b3060b281c6154b55f44

Contents?: true

Size: 618 Bytes

Versions: 2

Compression:

Stored size: 618 Bytes

Contents

require 'simplabs/excellent/checks/line_count_check'

module Simplabs

  module Excellent

    module Checks

      class ClassLineCountCheck < LineCountCheck

        DEFAULT_THRESHOLD = 300

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

        protected

          def node_to_count(node)
            node[3]
          end

          def error_args(node, line_count)
            ['Class {{class}} has {{count}} lines.', { :class => node[1], :count => line_count }]
          end

      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simplabs-excellent-1.0.0 lib/simplabs/excellent/checks/class_line_count_check.rb
simplabs-excellent-1.0.1 lib/simplabs/excellent/checks/class_line_count_check.rb