Sha256: ccdc5050bd192cc26ed65740e4c20663c87b20a42c7a3e76d427cc16d22386f2

Contents?: true

Size: 605 Bytes

Versions: 22

Compression:

Stored size: 605 Bytes

Contents

require 'reek/smells/smell_detector'
require 'reek/smell_warning'

module Reek
  module Smells

    #
    # A Nested Iterator occurs when a block contains another block.
    #
    # +NestedIterators+ reports failing methods only once.
    #
    class NestedIterators < SmellDetector

      def self.contexts      # :nodoc:
        [:iter]
      end

      #
      # Checks whether the given +block+ is inside another.
      # Remembers any smells found.
      #
      def examine_context(block)
        return false unless block.nested_block?
        found(block, 'is nested')
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
kevinrutherford-reek-1.1.3.10 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.11 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.12 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.13 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.14 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.15 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.16 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.3 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.4 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.5 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.6 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.7 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.8 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.1.3.9 lib/reek/smells/nested_iterators.rb
kevinrutherford-reek-1.2.0 lib/reek/smells/nested_iterators.rb
reek-1.2.6 lib/reek/smells/nested_iterators.rb
reek-1.2.5 lib/reek/smells/nested_iterators.rb
reek-1.2.4 lib/reek/smells/nested_iterators.rb
reek-1.2.3 lib/reek/smells/nested_iterators.rb
reek-1.2.2 lib/reek/smells/nested_iterators.rb