Sha256: 92060fda4d9cd432bad0ae1aa9e5def6d7ba882f5cd8cc6452b319993a30991b

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

require 'simplabs/excellent/checks/line_count_check'

module Simplabs

  module Excellent

    module Checks

      class ModuleLineCountCheck < LineCountCheck

        DEFAULT_THRESHOLD = 300

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

        protected

          def node_to_count(node)
            node[2]
          end

          def error_args(node, line_count)
            ['Module {{module}} has {{count}} lines.', { :module => 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/module_line_count_check.rb
simplabs-excellent-1.0.1 lib/simplabs/excellent/checks/module_line_count_check.rb