#34 ✓resolved
Ashley Moran

Stop class_eval/instance_eval being counted as a nested iterator

Reported by Ashley Moran | April 3rd, 2009 @ 03:04 PM

The following code:

@model_class.class_eval do |variable|
  persisted_entity_class.entity_class_properties.each do |ecp|
    property ecp.identifier.to_sym, String, :nullable => false
  end
end

causes this spec failure for me:

'dm-datamapper-adapter has no code smells' FAILED
Expected no smells, but got:
"lib/datamapper_adapter/model_class_factory.rb" -- 1 warnings:
DataMapper::Adapters::DataMapperAdapter#ModelClassFactory#ModelClassBuilder#add_properties!/block/block is nested (Nested Iterators)

Is there another way to structure this code? Or is this reek being over-sensitive to blocks? (I can't see a less-nested solution!)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Defects and feature requests for Reek, the Ruby code smell detector

People watching this ticket

Pages