Completed
Push — master ( 1b6594...be51ba )
by Agel_Nash
04:51
created

Database::insert()   C

Complexity

Conditions 13
Paths 33

Size

Total Lines 49
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 22
CRAP Score 13.292

Importance

Changes 0
Metric Value
cc 13
eloc 27
nc 33
nop 6
dl 0
loc 49
ccs 22
cts 25
cp 0.88
crap 13.292
rs 5.1401
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 namespace AgelxNash\Modx\Evo\Database;
2
3
class Database extends AbstractDatabase
4
{
5
    /**
6
     * @param array $config
7
     * @param string $driver
8
     * @throws Exceptions\Exception
9
     */
10 64
    public function __construct(array $config, $driver = Drivers\MySqliDriver::class)
11
    {
12 64
        $this->setConfig($config);
13 64
        $this->setDriver($driver);
14 64
    }
15
}
16