speedworks/speedy

View on GitHub

Showing 149 of 149 total issues

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

        $iv = "r@nD0mKey#osekj%^876ghjkjb5dDdf8";
Severity: Minor
Found in Core/Classes/System.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 $db. Configured minimum length is 3.
Open

        $db = DB::ADO();
Severity: Minor
Found in Core/Classes/BaseAuth.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 $rs. Configured minimum length is 3.
Open

        $rs = $db->Execute('SELECT * from users WHERE id = ? AND user_name = ? AND status = 1',[$uid, $uname]);
Severity: Minor
Found in Core/Classes/BaseAuth.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 classes with short names like DB. Configured minimum length is 3.
Open

class DB
{
    private $dsn=null;
    private $DBCON=null;
    private $table=null;
Severity: Minor
Found in Core/Classes/DB.php by phpmd

ShortClassName

Since: 2.9

Detects when classes or interfaces have a very short name.

Example

class Fo {

}

interface Fo {

}

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

Function MakeLog has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function MakeLog($logdir, $filename, $logstr)
    {
        $logstr .= "\n";
        if(is_dir($logdir.date('Y')))
        {
Severity: Minor
Found in Core/Classes/System.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    public function setEngine($engine, $host=null, $port=null, $user=null, $password=null, $encryption=null)
Severity: Minor
Found in Core/Classes/Mailer.php - About 45 mins to fix

    Function Pass has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function Pass($requestUri, $requestMethod, $requestData, $rawData)
        {
            if(!array_key_exists($requestMethod,Route::$URLS))
            {
                System::GiveError(405,"Method not allowed");
    Severity: Minor
    Found in Core/Bridge.php - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function corePHPMailer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function corePHPMailer($options)
        {
            $options = null;
            $this->mailHeaders[] = "MIME-Version: 1.0";
            $this->mailHeaders[] = "Content-Type: ".$this->mailContentType;
    Severity: Minor
    Found in Core/Classes/Mailer.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function DBD has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function DBD($inData, $die=false) //DEBUG AND DIE
        {
            if(is_array($inData))
            {
                echo "<pre><br/>\n";
    Severity: Minor
    Found in Core/Classes/System.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

        public static function view($view, $arrayParams = [], $exit = false)
    Severity: Minor
    Found in Core/Classes/BaseController.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 DBD has a boolean flag argument $die, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function DBD($inData, $die=false) //DEBUG AND DIE
    Severity: Minor
    Found in Core/Classes/System.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 FilterInput has a boolean flag argument $keepHTML, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function FilterInput($inData, $keepHTML=false)
    Severity: Minor
    Found in Core/Classes/System.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

    Function delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function delete($cookieName = null)
        {
            if($cookieName == null)
            {
                if (isset($_SERVER['HTTP_COOKIE']))
    Severity: Minor
    Found in Core/Classes/Cookie.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    The method GiveError() contains an exit expression.
    Open

            exit();
    Severity: Minor
    Found in Core/Classes/System.php by phpmd

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

    Source https://phpmd.org/rules/design.html#exitexpression

    The method __construct() contains an exit expression.
    Open

                die;
    Severity: Minor
    Found in Core/Classes/DB.php by phpmd

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

    Source https://phpmd.org/rules/design.html#exitexpression

    The method DBD() contains an exit expression.
    Open

                die;
    Severity: Minor
    Found in Core/Classes/System.php by phpmd

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

    Source https://phpmd.org/rules/design.html#exitexpression

    The method GiveJSON() contains an exit expression.
    Open

            exit();
    Severity: Minor
    Found in Core/Classes/System.php by phpmd

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

    Source https://phpmd.org/rules/design.html#exitexpression

    The method GiveResponse() contains an exit expression.
    Open

            exit();
    Severity: Minor
    Found in Core/Classes/System.php by phpmd

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

    Source https://phpmd.org/rules/design.html#exitexpression

    The method Pass() contains an exit expression.
    Open

                exit(0);
    Severity: Minor
    Found in Core/Bridge.php by phpmd

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

    Source https://phpmd.org/rules/design.html#exitexpression

    The method view() contains an exit expression.
    Open

                exit(1);
    Severity: Minor
    Found in Core/Classes/BaseController.php by phpmd

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

    Source https://phpmd.org/rules/design.html#exitexpression

    Severity
    Category
    Status
    Source
    Language