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

StateManager   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 15
ccs 0
cts 11
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLineState() 0 12 4
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