Sha256: eb43c7d0b104fd7dc7cbf46c29a9bb97a2a849f69b7ee32563a7c7be9d685075

Contents?: true

Size: 682 Bytes

Versions: 4

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # Common functionality for checking for too many lines.
    module TooManyLines
      include ConfigurableMax
      include CodeLength

      MSG = '%<label>s has too many lines. [%<length>d/%<max>d]'

      private

      def message(length, max_length)
        format(MSG, label: cop_label, length: length, max: max_length)
      end

      def code_length(node)
        Metrics::Utils::CodeLengthCalculator.new(node,
                                                 count_comments: count_comments?,
                                                 foldable_types: count_as_one).calculate
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rubocop-0.88.0 lib/rubocop/cop/mixin/too_many_lines.rb
rbhint-0.87.1.rc1 lib/rubocop/cop/mixin/too_many_lines.rb
rubocop-0.87.1 lib/rubocop/cop/mixin/too_many_lines.rb
rubocop-0.87.0 lib/rubocop/cop/mixin/too_many_lines.rb