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

Trap::read_trap()   F

Complexity

Conditions 15
Paths 385

Size

Total Lines 93
Code Lines 50

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
cc 15
eloc 50
c 3
b 1
f 0
nc 385
nop 1
dl 0
loc 93
rs 2.7708

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