DocumentationCheck   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 8 1
A getKey() 0 3 1
A getDescription() 0 3 1
1
<?php
2
3
namespace SilverStripe\ModuleRatings\Check;
4
5
class DocumentationCheck extends AbstractFileCheck
6
{
7
    public function getKey()
8
    {
9
        return 'has_documentation';
10
    }
11
12
    public function getDescription()
13
    {
14
        return 'Has documentation';
15
    }
16
17
    public function run()
18
    {
19
        $files = $this->getFinder()
20
            ->directories()
21
            ->in($this->getSuite()->getModuleRoot())
22
            ->name('/^docs?$/');
23
24
        $this->setSuccessful(count($files) > 0);
25
    }
26
}
27