| Total Complexity | 1 |
| Total Lines | 15 |
| Duplicated Lines | 100 % |
| Changes | 0 | ||
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | # frozen_string_literal: true |
||
| 12 | class Factory < Interface |
||
| 13 | # :nocov: |
||
| 14 | # @param [AMA::Entity::Mapper::Type] type Type that requires creation. |
||
| 15 | # While most probably it wouldn't be necessary, it is unknown until |
||
| 16 | # creation which exact type will be used (altering type parameters |
||
| 17 | # results in new type creation) |
||
| 18 | # @param [Object] data Data that will be used for object creation. |
||
| 19 | # May be of any type or even nil. |
||
| 20 | # @param [AMA::Entity::Mapper::Context] context |
||
| 21 | # @return [Object] Object of passed type. |
||
| 22 | def create(type, data = nil, context = nil) |
||
| 23 | abstract_method |
||
| 24 | end |
||
| 25 | # :nocov: |
||
| 26 | end |
||
| 27 | end |
||
| 31 |