mambax7/gbook

View on GitHub

Showing 307 of 307 total issues

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $options['rows']   = 25;
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $messageEditor = $utility::getEditor($helper, $options);
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $options['height'] = '400px';
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $options['value'] = $this->getVar('note', 'e');
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $options['value']  = $this->getVar('message', 'e');
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $options['width']  = '100%';
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $options['cols']   = '100%';
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $options['name']   = 'message';
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$options' which will lead to PHP notices.
Open

        $options['name']  = 'note';
Severity: Minor
Found in class/Entries.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$skipColumns' which will lead to PHP notices.
Open

    $skipColumns[] = 'gperm_id';
Severity: Minor
Found in testdata/index.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Method getServerStats has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getServerStats(): string
    {
        //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
        $moduleDirName      = \basename(\dirname(__DIR__, 2));
        $moduleDirNameUpper = mb_strtoupper($moduleDirName);
Severity: Minor
Found in class/Common/ServerStats.php - About 1 hr to fix

    Method loadSampleData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function loadSampleData()
    {
        global $xoopsConfig;
        $moduleDirName      = \basename(\dirname(__DIR__));
        $moduleDirNameUpper = mb_strtoupper($moduleDirName);
    Severity: Minor
    Found in testdata/index.php - About 1 hr to fix

      Method getForm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getForm($action = false): XoopsThemeForm
          {
              if (false === $action) {
                  $action = Request::getString('REQUEST_URI', '', 'SERVER');
              }
      Severity: Minor
      Found in class/Entries.php - About 1 hr to fix

        Each class must be in a namespace of at least one level (a top-level vendor name)
        Open

        class GbookCorePreload extends \XoopsPreloadItem
        Severity: Minor
        Found in preloads/core.php by phpcodesniffer

        Function rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function rmove($src, $dest): bool
            {
                // Only continue if user is a 'global' Admin
                if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                    return false;
        Severity: Minor
        Found in class/Common/FilesManagement.php - About 55 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function recurseCopy($src, $dst): void
            {
                $dir = \opendir($src);
                //        @mkdir($dst);
                if (!@\mkdir($dst) && !\is_dir($dst)) {
        Severity: Minor
        Found in class/Common/FilesManagement.php - About 55 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function rcopy($src, $dest): bool
            {
                // Only continue if user is a 'global' Admin
                if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                    return false;
        Severity: Minor
        Found in class/Common/FilesManagement.php - About 55 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

        A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 43 and the first side effect is on line 23.
        Open

        <?php
        Severity: Minor
        Found in include/common.php by phpcodesniffer

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

                $ip = 'UNKNOWN';
        Severity: Minor
        Found in class/Utility.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     = XoopsDatabaseFactory::getDatabaseConnection();
        Severity: Minor
        Found in class/Helper.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

        Severity
        Category
        Status
        Source
        Language