codeforamerica/ohana-api

View on GitHub
lib/holiday_schedule_importer.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

HolidayScheduleImporter#holiday_schedules contains iterators nested 2 deep
Open

      chunks.each { |row| result << HolidaySchedulePresenter.new(row).to_holiday_schedule }
Severity: Minor
Found in lib/holiday_schedule_importer.rb by reek

A Nested Iterator occurs when a block contains another block.

Example

Given

class Duck
  class << self
    def duck_names
      %i!tick trick track!.each do |surname|
        %i!duck!.each do |last_name|
          puts "full name is #{surname} #{last_name}"
        end
      end
    end
  end
end

Reek would report the following warning:

test.rb -- 1 warning:
  [5]:Duck#duck_names contains iterators nested 2 deep (NestedIterators)

There are no issues that match your filters.

Category
Status