Code Duplication    Length = 6-6 lines in 2 locations

lib/mapper/engine/recursive_mapper.rb 1 location

@@ 45-50 (lines=6) @@
42
            ctx.logger.debug("Mapping #{source.class} to type #{type.to_def}")
43
            source, reassembled = request_reassembly(source, type, ctx)
44
            epithet = reassembled ? 'reassembled' : 'source'
45
            if type.attributes.empty?
46
              message = "#{type.to_def} has no attributes, " \
47
                "returning #{epithet} instance"
48
              ctx.logger.debug(message)
49
              return source
50
            end
51
            process_attributes(source, type, ctx)
52
          end
53

lib/mapper/engine/recursive_normalizer.rb 1 location

@@ 40-45 (lines=6) @@
37
          # @param [AMA::Entity::Mapper::Type] type
38
          # @param [AMA::Entity::Mapper::Context] ctx
39
          def process_attributes(entity, type, ctx)
40
            if type.attributes.empty?
41
              message = "No attributes found on #{type.type}, returning " \
42
                "#{entity.class} as is"
43
              ctx.logger.debug(message)
44
              return entity
45
            end
46
            normalize_attributes(entity, type, ctx)
47
          end
48