| Conditions | 10 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 85.1337 |
| Changes | 0 | ||
Complex classes like Profesion.why() often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
| 1 | # Clase para gestionar las profesiones y sus grados. |
||
| 33 | 1 | def why |
|
| 34 | case imped |
||
| 35 | when 'clérigo' then 'Las artes Oscuras de la alquimia son heréticas' |
||
| 36 | when 'bárbaro' then 'Los bárbaros son analfabetos' |
||
| 37 | when 'elfo' then 'El cadáver de una bestia debe ser respetado' |
||
| 38 | when 'mago' then 'La mejor táctica suele ser quemarlo todo' |
||
| 39 | when 'enano' then 'Los encantamientos son deshonorables para la guerra' |
||
| 40 | when 'tiefling' then 'Prefieren alejarse de la plata, en la medida lo posible' |
||
| 41 | when 'rakshasa' then 'La madera es un material escaso en los lejanos desiertos del león' |
||
| 42 | when 'ladrón' then 'Se niegan a hacer horas extra, y tienen un código de honor.' |
||
| 43 | when 'elohim' then 'Según sus preceptos de fe, las aves son libres de toda servidumbre' |
||
| 44 | end |
||
| 45 | end |
||
| 46 | |||
| 48 |