GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SecurityChecker   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 8 2
A __clone() 0 1 1
A __construct() 0 1 1
B findIssues() 0 19 5
1
<?php
2
3
namespace Selim;
4
5
class SecurityChecker
6
{
7
    protected static $_instance = null;
8
    public static function getInstance()
9
    {
10
        if (null === self::$_instance)
11
        {
12
            self::$_instance = new self;
13
        }
14
        return self::$_instance;
15
    }
16
17
    protected function __clone() {}
18
19
    protected function __construct() {}
20
21
    public function findIssues(SilverstripePage $sspage, $is_cli = false)
22
    {
23
        $issues = [];
24
25
        $version = $sspage->getVersion();
26
        if ($is_cli && !Util::VersionStringsGreaterThenOrEqual($version, "3.0")) {
27
            array_push($issues, "IMPORTANT: It seems as if you are running Silverstripe 2. Support for this version of Silverstripe ended March 31st 2015");
28
        }
29
30
        if($sspage->hasDefaultAdmin()){
31
            array_push($issues, "IMPORTANT: Security::setDefaultAdmin() is used.");
32
        }
33
34
        if($sspage->getEnvironmentType() == "dev"){
35
            array_push($issues, "WARNING: Director.environment_type is set to 'dev'");
36
        }
37
38
        return $issues;
39
    }
40
}
41