Passed
Push — master ( 185cb1...b3870e )
by Patrick
01:50
created

Trap::getRules()   B

Complexity

Conditions 11
Paths 6

Size

Total Lines 55
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 11
eloc 28
c 2
b 0
f 0
nc 6
nop 2
dl 0
loc 55
rs 7.3166

How to fix   Long Method    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
4
//No autoloader when running in CLI.
5
6
include (dirname(__DIR__).'/library/Trapdirector/Icinga2Api.php');
7
include (dirname(__DIR__).'/library/Trapdirector/TrapsProcess/Logging.php');
8
include (dirname(__DIR__).'/library/Trapdirector/TrapsProcess/Database.php');
9
include (dirname(__DIR__).'/library/Trapdirector/TrapsProcess/Mib.php');
10
include (dirname(__DIR__).'/library/Trapdirector/TrapsProcess/Rule.php');
11
12
include (dirname(__DIR__).'/library/Trapdirector/TrapsProcess/Trap.php');
13
14