Completed
Push — master ( 83f315...077de2 )
by Demonchaux
02:12
created

StateManager::getLineState()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 12
ccs 0
cts 11
cp 0
rs 9.2
cc 4
eloc 8
nc 4
nop 1
crap 20
1
<?php
2
3
/**
4
 * This file is part of the Clover to Html package.
5
 *
6
 * (c) Stéphane Demonchaux <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace CloverToHtml;
12
13
class StateManager
14
{
15
    public function getLineState(StatsInterface $stats)
16
    {
17
        $pourcent = $stats->getLineCoveredPourcent();
18
19
        if ($pourcent > 70) {
20
            return 'green';
21
        } elseif ($pourcent > 50) {
22
            return 'warning';
23
        } elseif ($pourcent > 40) {
24
            return 'danger';
25
        }
26
    }
27
}
28