Sha256: c61d93895c23948c076d3d53ccfd8b44b0859281df5c2bf7e6396ab1759e8ec8

Contents?: true

Size: 620 Bytes

Versions: 15

Compression:

Stored size: 620 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Metrics
      # This cop checks if the length a class exceeds some maximum value.
      # Comment lines can optionally be ignored.
      # The maximum allowed length is configurable.
      class ClassLength < Cop
        include ClassishLength

        def on_class(node)
          check_code_length(node)
        end

        private

        def message(length, max_length)
          format('Class has too many lines. [%<length>d/%<max>d]',
                 length: length,
                 max: max_length)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
rubocop-0.59.1 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.59.0 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.58.2 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.58.1 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.58.0 lib/rubocop/cop/metrics/class_length.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rubocop-0.57.2/lib/rubocop/cop/metrics/class_length.rb
rubocop-0.57.2 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.57.1 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.57.0 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.56.0 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.55.0 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.54.0 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.53.0 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.52.1 lib/rubocop/cop/metrics/class_length.rb
rubocop-0.52.0 lib/rubocop/cop/metrics/class_length.rb