Completed
Push — master ( 56ea51...11e69c )
by Rob
04:30 queued 10s
created

BaseOptions::getOptions()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 74
Code Lines 59

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1.0046

Importance

Changes 0
Metric Value
cc 1
eloc 59
nc 1
nop 0
dl 0
loc 74
ccs 5
cts 6
cp 0.8333
crap 1.0046
rs 8.8945
c 0
b 0
f 0

How to fix   Long Method   

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
namespace devtoolboxuk\cerberus;
4
5
class BaseOptions
6
{
7
8 4
    public function getOptions()
9
    {
10 4
        return [
11
            'Detection' => [
12
                'Rules' => [
13
                    'BotBlock' => [
14
                        'active' => 1,
15 4
                        'score' => 1,
16
                        'params' => '360Spider'
17
                    ],
18
                    'Html' => [
19
                        'active' => 1,
20
                        'score' => 1,
21
                        'params' => '',
22
                    ],
23
                    'StringLength' => [
24
                        'active' => 1,
25
                        'score' => 1,
26
                        'params' => '',
27
                    ],
28
                    'Numeric' => [
29
                        'active' => 1,
30
                        'score' => 1,
31
                        'params' => '',
32
                    ],
33
                    'Url' => [
34
                        'active' => 1,
35
                        'score' => 1,
36
                        'params' => '',
37
                    ],
38
                    'Ip' => [
39
                        'active' => 1,
40
                        'score' => 1,
41
                        'params' => '',
42
                    ],
43
                    'Tor' => [
44
                        'active' => 1,
45
                        'score' => 1,
46
                        'params' => '',
47
                    ],
48
                    'DisposableEmail' => [
49
                        'active' => 1,
50
                        'score' => 10,
51
                        'params' => '',
52
                    ],
53
                    'InvalidEmail' => [
54
                        'active' => 1,
55
                        'score' => 1,
56
                        'params' => '',
57
                    ],
58
                    'QueryStringKey' => [
59
                        'active' => 1,
60
                        'score' => 1,
61
                        'params' => '',
62
                    ],
63
                    'QueryStringValue' => [
64
                        'active' => 1,
65
                        'score' => 1,
66
                        'params' => '',
67
                    ],
68
                    'DifferentCountry' => [
69
                        'active' => 1,
70
                        'score' => 10,
71
                        'params' => '',
72
                    ],
73
                    'Country' => [
74
                        'active' => 1,
75
                        'score' => 10,
76
                        'params' => '',
77
                    ],
78
                    'Xss' => [
79 4
                        'active' => 1,
80
                        'score' => 10,
81 4
                        'params' => '',
82
                    ]
83
                ]
84
            ]
85
86
        ];
87
88
    }
89
90
    private function isYamlLoaded()
0 ignored issues
show
Unused Code introduced by
The method isYamlLoaded() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
91
    {
92
        return extension_loaded('yaml');
93
    }
94
}