lib/Ajde/Log/Writer/File.php

Summary

Maintainability
A
45 mins
Test Coverage

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

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

    Missing class import via use statement (line '21', column '23').
    Open

                throw new Ajde_Exception(sprintf('Directory %s is not writable', LOG_DIR), 90014);
    Severity: Minor
    Found in lib/Ajde/Log/Writer/File.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    TODO found
    Open

                // TODO, throw error here??
    Severity: Minor
    Found in lib/Ajde/Log/Writer/File.php by fixme

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

        public static function _(
            $message,
            $channel = Ajde_Log::CHANNEL_INFO,
            $level = Ajde_Log::LEVEL_INFORMATIONAL,
            $description = '',
    Severity: Minor
    Found in lib/Ajde/Log/Writer/File.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

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

            $fh = fopen($filename, 'a');
    Severity: Minor
    Found in lib/Ajde/Log/Writer/File.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

    The class Ajde_Log_Writer_File is not named in CamelCase.
    Open

    class Ajde_Log_Writer_File extends Ajde_Log_Writer_Abstract
    {
        private static function _getFilename()
        {
            return LOG_DIR.date('Ymd').'.log';
    Severity: Minor
    Found in lib/Ajde/Log/Writer/File.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 _getFilename is not named in camelCase.
    Open

        private static function _getFilename()
        {
            return LOG_DIR.date('Ymd').'.log';
        }
    Severity: Minor
    Found in lib/Ajde/Log/Writer/File.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

    The method _ is not named in camelCase.
    Open

        public static function _(
            $message,
            $channel = Ajde_Log::CHANNEL_INFO,
            $level = Ajde_Log::LEVEL_INFORMATIONAL,
            $description = '',
    Severity: Minor
    Found in lib/Ajde/Log/Writer/File.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