HuasoFoundries/jpgraph

View on GitHub
src/util/JpGraphError.php

Summary

Maintainability
A
45 mins
Test Coverage

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

    public static function RaiseL($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
Severity: Minor
Found in src/util/JpGraphError.php - About 45 mins to fix

    The method SetImageFlag has a boolean flag argument $aFlg, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function SetImageFlag($aFlg = true)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method Raise has a boolean flag argument $aHalt, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function Raise($aMsg, $aHalt = true)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Avoid unused parameters such as '$aHalt'.
    Open

        public static function Raise($aMsg, $aHalt = true)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

        public static function RaiseL($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
    Severity: Minor
    Found in src/util/JpGraphError.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

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

        public static function RaiseL($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
    Severity: Minor
    Found in src/util/JpGraphError.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

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

        public static function RaiseL($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
    Severity: Minor
    Found in src/util/JpGraphError.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

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

        public static function RaiseL($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
    Severity: Minor
    Found in src/util/JpGraphError.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

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

        public static function RaiseL($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
    Severity: Minor
    Found in src/util/JpGraphError.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

    Property name "$__iTitle" should not be prefixed with an underscore to indicate visibility
    Open

        private static $__iTitle   = 'JpGraph Error: ';
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::SetTitle" is not in camel caps format
    Open

        public static function SetTitle($aTitle)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::Raise" is not in camel caps format
    Open

        public static function Raise($aMsg, $aHalt = true)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::SetErrLocale" is not in camel caps format
    Open

        public static function SetErrLocale($aLoc)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::SetImageFlag" is not in camel caps format
    Open

        public static function SetImageFlag($aFlg = true)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::GetImageFlag" is not in camel caps format
    Open

        public static function GetImageFlag()
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::SetLogFile" is not in camel caps format
    Open

        public static function SetLogFile($aFile)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::GetLogFile" is not in camel caps format
    Open

        public static function GetLogFile()
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Property name "$__iLogFile" should not be prefixed with an underscore to indicate visibility
    Open

        private static $__iLogFile = '';
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::GetTitle" is not in camel caps format
    Open

        public static function GetTitle()
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Property name "$__iImgFlg" should not be prefixed with an underscore to indicate visibility
    Open

        private static $__iImgFlg  = true;
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    Method name "JpGraphError::RaiseL" is not in camel caps format
    Open

        public static function RaiseL($errnbr, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
    Severity: Minor
    Found in src/util/JpGraphError.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status