GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

HistogramEntity::__construct()   C
last analyzed

Complexity

Conditions 7
Paths 7

Size

Total Lines 27
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 17
CRAP Score 7

Importance

Changes 0
Metric Value
dl 0
loc 27
ccs 17
cts 17
cp 1
rs 6.7272
c 0
b 0
f 0
cc 7
eloc 18
nc 7
nop 1
crap 7
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2015-09-09
7
 *
8
 * @link:    https://github.com/msiebeneicher/chapi/issues/24
9
 */
10
11
namespace Chapi\Entity\Chronos\JobStatsEntity;
12
13
class HistogramEntity
14
{
15
    /** @var float  */
16
    public $percentile75th = 0.0;
17
18
    /** @var float  */
19
    public $percentile95th = 0.0;
20
21
    /** @var float  */
22
    public $percentile98th = 0.0;
23
24
    /** @var float  */
25
    public $percentile99th = 0.0;
26
27
    /** @var float  */
28
    public $median = 0.0;
29
30
    /** @var float  */
31
    public $mean = 0.0;
32
33
    /** @var int  */
34
    public $count = 0;
35
36
    /**
37
     * @param array $histogram
38
     */
39 6
    public function __construct(array $histogram = [])
40
    {
41 6
        foreach ($histogram as $key => $value) {
42
            switch ($key) {
43 5
                case '75thPercentile':
44 5
                    $this->percentile75th = $value;
45 5
                    break;
46
47 5
                case '95thPercentile':
48 5
                    $this->percentile95th = $value;
49 5
                    break;
50
51 5
                case '98thPercentile':
52 5
                    $this->percentile98th = $value;
53 5
                    break;
54
55 5
                case '99thPercentile':
56 5
                    $this->percentile99th = $value;
57 5
                    break;
58
59
                default:
60 5
                    if (property_exists($this, $key)) {
61 5
                        $this->{$key} = $value;
62
                    }
63
            }
64
        }
65 6
    }
66
}
67