StateManager   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

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):? string
16
    {
17
        $percent = $stats->getLineCoveredPercent();
18
19
        if ($percent > 70) {
20
            return 'green';
21
        } elseif ($percent > 50) {
22
            return 'warning';
23
        } elseif ($percent > 40) {
24
            return 'danger';
25
        }
26
    }
27
}
28