Passed
Push — master ( 93e91b...83695f )
by Fabien
02:05
created

AfterAnalysisEvent::getMaxNumberOfChanges()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Churn\Event\Event;
6
7
use Churn\Result\ResultAccumulator;
8
9
/**
10
 * @internal
11
 */
12
final class AfterAnalysisEvent implements AfterAnalysis
13
{
14
15
    /**
16
     * @var ResultAccumulator
17
     */
18
    private $resultAccumulator;
19
20
    /**
21
     * @param ResultAccumulator $resultAccumulator The results report.
22
     */
23
    public function __construct(ResultAccumulator $resultAccumulator)
24
    {
25
        $this->resultAccumulator = $resultAccumulator;
26
    }
27
28
    /**
29
     * Returns the total number of files analysed.
30
     */
31
    public function getNumberOfFiles(): int
32
    {
33
        return $this->resultAccumulator->getNumberOfFiles();
34
    }
35
36
    /**
37
     * Returns the max number of changes among the analysed files.
38
     */
39
    public function getMaxNumberOfChanges(): int
40
    {
41
        return $this->resultAccumulator->getMaxCommits();
42
    }
43
44
    /**
45
     * Returns the max cyclomatic complexity among the analysed files.
46
     */
47
    public function getMaxCyclomaticComplexity(): int
48
    {
49
        return $this->resultAccumulator->getMaxComplexity();
50
    }
51
52
    /**
53
     * Returns the highest score among the analysed files.
54
     */
55
    public function getMaxScore(): ?float
56
    {
57
        return $this->resultAccumulator->getMaxScore();
58
    }
59
}
60