Asymptix/Framework

View on GitHub
conf/Config.php

Summary

Maintainability
A
0 mins
Test Coverage

getDBConfig accesses the super-global variable $_SERVER.
Open

    public static function getDBConfig() {
        if (isset($_SERVER['HTTP_HOST']) && isset(self::$db[$_SERVER['HTTP_HOST']])) {
            return self::$db[$_SERVER['HTTP_HOST']];
        }
        return self::$db['default'];
Severity: Minor
Found in conf/Config.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

getDBConfig accesses the super-global variable $_SERVER.
Open

    public static function getDBConfig() {
        if (isset($_SERVER['HTTP_HOST']) && isset(self::$db[$_SERVER['HTTP_HOST']])) {
            return self::$db[$_SERVER['HTTP_HOST']];
        }
        return self::$db['default'];
Severity: Minor
Found in conf/Config.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

isDevServer accesses the super-global variable $_SERVER.
Open

    public static function isDevServer() {
        return ($_SERVER['SERVER_ADDR'] == '127.0.0.1');
    }
Severity: Minor
Found in conf/Config.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

getDBConfig accesses the super-global variable $_SERVER.
Open

    public static function getDBConfig() {
        if (isset($_SERVER['HTTP_HOST']) && isset(self::$db[$_SERVER['HTTP_HOST']])) {
            return self::$db[$_SERVER['HTTP_HOST']];
        }
        return self::$db['default'];
Severity: Minor
Found in conf/Config.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

Avoid variables with short names like $db. Configured minimum length is 3.
Open

    public static $db = [
        'default' => [
            'HOST' => "localhost",
            'DBNAME' => "dbname",
            'USER' => "root",
Severity: Minor
Found in conf/Config.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

There are no issues that match your filters.

Category
Status