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::findIssues()   B
last analyzed

Complexity

Conditions 5
Paths 8

Size

Total Lines 19
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 10
nc 8
nop 2
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