CodeOrSrcFolderCheck   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

3 Methods

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