Sha256: f4f697faafb2147af0d6cbbe42ce7d392336650adefd76dcb347b45de263184c

Contents?: true

Size: 367 Bytes

Versions: 10

Compression:

Stored size: 367 Bytes

Contents

module SandiMeter
  class LOCChecker < Struct.new(:file_lines)

    MAX_LOC = {
      'def'   => 5,
      'class' => 100
    }

    def check(params, token)
      _, first_line, last_line = params
      locs_size(first_line, last_line) <= MAX_LOC[token]
    end

    private
    def locs_size(first_line, last_line)
      last_line - first_line - 1
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sandi_meter-1.2.0 lib/sandi_meter/loc_checker.rb
sandi_meter-1.1.8 lib/sandi_meter/loc_checker.rb
sandi_meter-1.1.7 lib/sandi_meter/loc_checker.rb
sandi_meter-1.1.6 lib/sandi_meter/loc_checker.rb
sandi_meter-1.1.5 lib/sandi_meter/loc_checker.rb
sandi_meter-1.0.5 lib/sandi_meter/loc_checker.rb
sandi_meter-1.0.4 lib/sandi_meter/loc_checker.rb
sandi_meter-1.0.3 lib/sandi_meter/loc_checker.rb
sandi_meter-1.0.2 lib/sandi_meter/loc_checker.rb
sandi_meter-1.0.1 lib/sandi_meter/loc_checker.rb