Passed
Push — main ( fcc13f...628042 )
by mikhail
02:55
created

DocBlockComment::getColor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SavinMikhail\CommentsDensity\Comments;
6
7
final class DocBlockComment extends Comment implements CommentTypeInterface
8
{
9 2
    public function getPattern(): string
10
    {
11 2
        return '/\/\*\*(?!.*\b(?:license|copyright|permission)\b).+?\*\//is';
12
    }
13
14 1
    public function getColor(): string
15
    {
16 1
        return 'green';
17
    }
18
19 1
    public function getStatColor(int $count, array $thresholds): string
20
    {
21 1
        if (! isset($thresholds[$this->getName()])) {
22 1
            return 'white';
23
        }
24
        if ($count >= $thresholds[$this->getName()]) {
25
            return 'green';
26
        }
27
        $this->exceedThreshold = true;
28
        return 'red';
29
    }
30
31 2
    public function getWeight(): float
32
    {
33 2
        return 1;
34
    }
35
36 2
    public function getAttitude(): string
37
    {
38 2
        return 'good';
39
    }
40
41 2
    public function getName(): string
42
    {
43 2
        return 'docBlock';
44
    }
45
}
46