@@ 5-27 (lines=23) @@ | ||
2 | ||
3 | namespace SilverStripe\ModuleRatings\Check; |
|
4 | ||
5 | class CodeCoverageGoodCheck extends AbstractCodeCoverageCheck |
|
6 | { |
|
7 | protected $threshold = 40; |
|
8 | ||
9 | protected $points = 5; |
|
10 | ||
11 | public function getKey() |
|
12 | { |
|
13 | return 'good_code_coverage'; |
|
14 | } |
|
15 | ||
16 | public function getDescription() |
|
17 | { |
|
18 | return 'Has a "good" level of code coverage (greater than ' . $this->threshold . '%, requires slug)'; |
|
19 | } |
|
20 | ||
21 | public function run() |
|
22 | { |
|
23 | if ($this->getCoverage() >= $this->getThreshold()) { |
|
24 | $this->setSuccessful(true); |
|
25 | } |
|
26 | } |
|
27 | } |
|
28 |
@@ 5-27 (lines=23) @@ | ||
2 | ||
3 | namespace SilverStripe\ModuleRatings\Check; |
|
4 | ||
5 | class CodeCoverageGreatCheck extends AbstractCodeCoverageCheck |
|
6 | { |
|
7 | protected $threshold = 60; |
|
8 | ||
9 | protected $points = 5; |
|
10 | ||
11 | public function getKey() |
|
12 | { |
|
13 | return 'great_code_coverage'; |
|
14 | } |
|
15 | ||
16 | public function getDescription() |
|
17 | { |
|
18 | return 'Has a "great" level of code coverage (greater than ' . $this->threshold . '%, requires slug)'; |
|
19 | } |
|
20 | ||
21 | public function run() |
|
22 | { |
|
23 | if ($this->getCoverage() >= $this->getThreshold()) { |
|
24 | $this->setSuccessful(true); |
|
25 | } |
|
26 | } |
|
27 | } |
|
28 |