Passed
Push — master ( 23a04c...2a6364 )
by Gabriel
16:49 queued 01:48
created

data_set()   D

Complexity

Conditions 20
Paths 34

Size

Total Lines 49
Code Lines 31

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 420

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 20
eloc 31
c 1
b 0
f 1
nc 34
nop 4
dl 0
loc 49
ccs 0
cts 0
cp 0
crap 420
rs 4.1666

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
2
3
use Nip\Collections\Collection;
4
5
if (! function_exists('collect')) {
6
    /**
7
     * Create a collection from the given value.
8
     *
9
     * @param  mixed  $value
10
     * @return Collection
11
     */
12
    function collect($value = null)
13
    {
14
        return new Collection($value);
15
    }
16
}
17