Pergamino   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 94.12 %

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
dl 16
loc 17
ccs 5
cts 9
cp 0.5556
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A max() 3 3 1
A hechizos() 3 3 1
A precio() 3 3 1
A name() 3 3 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
# Tipos de pergamino
2 View Code Duplication
# TODO: Mapear los hechizos
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3 1
class Pergamino < Util
4 1
  def name
5
    pergamino(id)['name']
6
  end
7
8 1
  def precio
9
    pergamino(id)['precio']
10
  end
11
12 1
  def max # Max num. permitido
13
    pergamino(id)['hechizos']
14
  end
15
16 1
  def hechizos
17
    spells.map { |s| Elemental.new(id: s).name }
18
  end
19
end
20