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

Trap::applyRules()   F

Complexity

Conditions 16
Paths 315

Size

Total Lines 103
Code Lines 52

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 16
eloc 52
c 2
b 0
f 0
nc 315
nop 0
dl 0
loc 103
rs 3.2958

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