Passed
Push — master ( 77f637...fcb0ff )
by Nico
36:40 queued 16:01
created

ShipStateEnum::getDescription()   B

Complexity

Conditions 10
Paths 10

Size

Total Lines 23
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 110

Importance

Changes 0
Metric Value
cc 10
eloc 20
nc 10
nop 1
dl 0
loc 23
ccs 0
cts 11
cp 0
crap 110
rs 7.6666
c 0
b 0
f 0

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Ship;
6
7
enum ShipStateEnum: int
8
{
9
    case SHIP_STATE_NONE = 0;
10
    case SHIP_STATE_REPAIR_PASSIVE = 1;
11
    case SHIP_STATE_ASTRO_FINALIZING = 2;
12
    case SHIP_STATE_UNDER_CONSTRUCTION = 3;
13
    case SHIP_STATE_REPAIR_ACTIVE = 4;
14
    case SHIP_STATE_UNDER_SCRAPPING = 5;
15
    case SHIP_STATE_DESTROYED = 6;
16
    case SHIP_STATE_WEB_SPINNING = 7;
17
    case SHIP_STATE_ACTIVE_TAKEOVER = 8;
18
}
19