Completed
Pull Request — master (#7)
by Marcelo
43s
created

ArrayOf   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
dl 14
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 4 4 1
A coerce_not_nil() 5 5 1

How to fix   Duplicated Code   

Duplicated Code

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
module Koine
2
  module Attributes
3
    module Adapter
4 View Code Duplication
      class ArrayOf < Base
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5
        def initialize(adapter)
6
          @adapter = adapter
7
          with_default_value([])
8
        end
9
10
        private
11
12
        def coerce_not_nil(collectionOfValues)
13
          secure do
14
            collectionOfValues.map { |value| @adapter.coerce(value) }
15
          end
16
        end
17
      end
18
    end
19
  end
20
end
21