Sha256: fdbfd8ce70d52913df7af994c8c71263ca9f1b1d7e232548d29f3c14484d5df0

Contents?: true

Size: 679 Bytes

Versions: 11

Compression:

Stored size: 679 Bytes

Contents

# Nested Iterators

## Introduction

A `Nested Iterator` occurs when a block contains another block.

## Example

Given

```Ruby
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)
```

## Current Support in Reek

Nested Iterators reports failing methods only once.

## Configuration

`Nested Iterators` offers the [Basic Smell Options](Basic-Smell-Options.md).

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
reek-3.3.0 docs/Nested-Iterators.md
reek-3.2.1 docs/Nested-Iterators.md
reek-3.2 docs/Nested-Iterators.md
reek-3.1 docs/Nested-Iterators.md
reek-3.0.4 docs/Nested-Iterators.md
reek-3.0.3 docs/Nested-Iterators.md
reek-3.0.2 docs/Nested-Iterators.md
reek-3.0.1 docs/Nested-Iterators.md
reek-3.0.0 docs/Nested-Iterators.md
reek-2.2.1 docs/Nested-Iterators.md
reek-2.2.0 docs/Nested-Iterators.md