| Total Complexity | 5 |
| Total Lines | 22 |
| 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 |
||
| 4 | View Code Duplication | class Armadura < Item |
|
|
|
|||
| 5 | def name |
||
| 6 | armadura(id)['name'] |
||
| 7 | end |
||
| 8 | |||
| 9 | # Defensa base del personaje |
||
| 10 | def defensa |
||
| 11 | armadura(id)['defensa'] |
||
| 12 | end |
||
| 13 | |||
| 14 | def categoria |
||
| 15 | armadura(id)['categoria'] |
||
| 16 | end |
||
| 17 | |||
| 18 | def precio |
||
| 19 | armadura(id)['precio'] |
||
| 20 | end |
||
| 21 | |||
| 22 | def fits |
||
| 23 | 'armadura' |
||
| 24 | end |
||
| 25 | end |
||
| 26 |