AfterAnalysisEvent   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 11
c 1
b 0
f 0
dl 0
loc 49
rs 10

5 Methods

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