speedworks/speedy

View on GitHub

Showing 149 of 149 total issues

__construct accesses the super-global variable $_ENV.
Open

    protected function __construct()
    {
        $this->dsn=$_ENV['DB_TYPE'].':dbname='.$_ENV['DB_NAME'].';host='.$_ENV['DB_SERVER'].';port='.$_ENV['DB_PORT'].';charset='.$_ENV['DB_CHARSET'];
        try
        {
Severity: Minor
Found in Core/Classes/DB.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

__construct accesses the super-global variable $_ENV.
Open

    private function __construct()
    {
        $this->mailEngine = $_ENV['mail']['engine'];
        $this->mailHost = $_ENV['mail']['host'];
        $this->mailPort = $_ENV['mail']['port'];
Severity: Minor
Found in Core/Classes/Mailer.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

__construct accesses the super-global variable $_ENV.
Open

    private function __construct()
    {
        $this->mailEngine = $_ENV['mail']['engine'];
        $this->mailHost = $_ENV['mail']['host'];
        $this->mailPort = $_ENV['mail']['port'];
Severity: Minor
Found in Core/Classes/Mailer.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

init accesses the super-global variable $_ENV.
Open

    private static function init()
    {
        $session_factory = new SessionFactory;
        $session = $session_factory->newInstance($_COOKIE);
        $session->setCookieParams(array('lifetime' => $_ENV['session_life']));
Severity: Minor
Found in Core/Classes/Session.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

GenerateSecret accesses the super-global variable $_ENV.
Open

    public static function GenerateSecret($digestString)
    {
        $digestString.='|'.$_ENV['app_key'].'|'.microtime(true);
        $hash = hash_hmac('crc32b', $digestString, microtime(true), false);
        return $hash;
Severity: Minor
Found in Core/Classes/System.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

__construct accesses the super-global variable $_ENV.
Open

    public function __construct()
    {
        require (__DIR__ . "/Classes/Helpers.php");
        require (__DIR__ . "/../App/Routes.php");
        header('Access-Control-Allow-Origin: '.$_ENV['cors']);
Severity: Minor
Found in Core/Bridge.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ExceptionHandler accesses the super-global variable $_ENV.
Open

function ExceptionHandler($exception)
{
    header("HTTP/1.0 500 Server Error");
    if($_ENV['debug'] == true)
    {
Severity: Minor
Found in public/index.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

verifyToken accesses the super-global variable $_SESSION.
Open

    public function verifyToken()
    {
        if(isset($_POST['csrf_token']) && !empty($_POST['csrf_token']) && isset($_SESSION['csrf_token']))
        {
            if(hash_equals($_SESSION['csrf_token'], $_POST['csrf_token']))
Severity: Minor
Found in Core/Classes/BaseCSRF.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

get accesses the super-global variable $_COOKIE.
Open

    public static function get($cookieName = null)
    {
        if($cookieName == null)
        {
            return $_COOKIE;
Severity: Minor
Found in Core/Classes/Cookie.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

GiveError accesses the super-global variable $_ENV.
Open

    public static function GiveError($errorCode, $errorMessage)
    {
        if($errorCode==400)
        {
            header("HTTP/1.0 400 Bad Request");
Severity: Minor
Found in Core/Classes/System.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ADO accesses the super-global variable $_ENV.
Open

    public static function ADO()
    {
        $db = ADONewConnection($_ENV['DB_ADO_DRIVER']);
        $db->connect($_ENV['DB_SERVER'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
        return $db;
Severity: Minor
Found in Core/Classes/DB.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

__construct accesses the super-global variable $_ENV.
Open

    protected function __construct()
    {
        $this->dsn=$_ENV['DB_TYPE'].':dbname='.$_ENV['DB_NAME'].';host='.$_ENV['DB_SERVER'].';port='.$_ENV['DB_PORT'].';charset='.$_ENV['DB_CHARSET'];
        try
        {
Severity: Minor
Found in Core/Classes/DB.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

__construct accesses the super-global variable $_ENV.
Open

    protected function __construct()
    {
        $this->dsn=$_ENV['DB_TYPE'].':dbname='.$_ENV['DB_NAME'].';host='.$_ENV['DB_SERVER'].';port='.$_ENV['DB_PORT'].';charset='.$_ENV['DB_CHARSET'];
        try
        {
Severity: Minor
Found in Core/Classes/DB.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

__construct accesses the super-global variable $_ENV.
Open

    private function __construct()
    {
        $this->mailEngine = $_ENV['mail']['engine'];
        $this->mailHost = $_ENV['mail']['host'];
        $this->mailPort = $_ENV['mail']['port'];
Severity: Minor
Found in Core/Classes/Mailer.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

__construct accesses the super-global variable $_ENV.
Open

    private function __construct()
    {
        $this->mailEngine = $_ENV['mail']['engine'];
        $this->mailHost = $_ENV['mail']['host'];
        $this->mailPort = $_ENV['mail']['port'];
Severity: Minor
Found in Core/Classes/Mailer.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

The method GiveError() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
Open

    public static function GiveError($errorCode, $errorMessage)
    {
        if($errorCode==400)
        {
            header("HTTP/1.0 400 Bad Request");
Severity: Minor
Found in Core/Classes/System.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

GiveError accesses the super-global variable $_ENV.
Open

    public static function GiveError($errorCode, $errorMessage)
    {
        if($errorCode==400)
        {
            header("HTTP/1.0 400 Bad Request");
Severity: Minor
Found in Core/Classes/System.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

loadConfig accesses the super-global variable $_ENV.
Open

function loadConfig()
{
    $config = require_once __DIR__ . '/../App/config.php';
    foreach ($config as $key => $value) {
        $_ENV[$key] = $value;
Severity: Minor
Found in public/index.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

verifyToken accesses the super-global variable $_POST.
Open

    public function verifyToken()
    {
        if(isset($_POST['csrf_token']) && !empty($_POST['csrf_token']) && isset($_SESSION['csrf_token']))
        {
            if(hash_equals($_SESSION['csrf_token'], $_POST['csrf_token']))
Severity: Minor
Found in Core/Classes/BaseCSRF.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

__construct accesses the super-global variable $_ENV.
Open

    protected function __construct()
    {
        $this->dsn=$_ENV['DB_TYPE'].':dbname='.$_ENV['DB_NAME'].';host='.$_ENV['DB_SERVER'].';port='.$_ENV['DB_PORT'].';charset='.$_ENV['DB_CHARSET'];
        try
        {
Severity: Minor
Found in Core/Classes/DB.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Severity
Category
Status
Source
Language