lib/Ajde/Log/Writer/Abstract.php

Summary

Maintainability
A
45 mins
Test Coverage

getIP accesses the super-global variable $_SERVER.
Open

    public static function getIP()
    {
        return issetor($_SERVER['REMOTE_ADDR']);
    }
Severity: Minor
Found in lib/Ajde/Log/Writer/Abstract.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

getUserAgent accesses the super-global variable $_SERVER.
Open

    public static function getUserAgent()
    {
        return issetor($_SERVER['HTTP_USER_AGENT']);
    }
Severity: Minor
Found in lib/Ajde/Log/Writer/Abstract.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

getRequest accesses the super-global variable $_SERVER.
Open

    public static function getRequest()
    {
        return issetor($_SERVER['REQUEST_URI']);
    }
Severity: Minor
Found in lib/Ajde/Log/Writer/Abstract.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

getReferer accesses the super-global variable $_SERVER.
Open

    public static function getReferer()
    {
        return issetor($_SERVER['HTTP_REFERER']);
    }
Severity: Minor
Found in lib/Ajde/Log/Writer/Abstract.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

Method _ has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $message,
        $channel = self::CHANNEL_INFO,
        $level = self::LEVEL_INFORMATIONAL,
        $description = '',
        $code = '',
Severity: Minor
Found in lib/Ajde/Log/Writer/Abstract.php - About 45 mins to fix

    Avoid using short method names like Ajde_Log_Writer_Abstract::_(). The configured minimum method name length is 3.
    Open

        abstract public static function _(
            $message,
            $channel = self::CHANNEL_INFO,
            $level = self::LEVEL_INFORMATIONAL,
            $description = '',
    Severity: Minor
    Found in lib/Ajde/Log/Writer/Abstract.php by phpmd

    ShortMethodName

    Since: 0.2

    Detects when very short method names are used.

    Example

    class ShortMethod {
        public function a( $index ) { // Violation
        }
    }

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

    The class Ajde_Log_Writer_Abstract is not named in CamelCase.
    Open

    abstract class Ajde_Log_Writer_Abstract
    {
        abstract public static function _(
            $message,
            $channel = self::CHANNEL_INFO,
    Severity: Minor
    Found in lib/Ajde/Log/Writer/Abstract.php by phpmd

    CamelCaseClassName

    Since: 0.2

    It is considered best practice to use the CamelCase notation to name classes.

    Example

    class class_name {
    }

    Source

    The method _ is not named in camelCase.
    Open

        abstract public static function _(
            $message,
            $channel = self::CHANNEL_INFO,
            $level = self::LEVEL_INFORMATIONAL,
            $description = '',
    Severity: Minor
    Found in lib/Ajde/Log/Writer/Abstract.php by phpmd

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status