mambax7/publisher

View on GitHub

Showing 3,032 of 3,032 total issues

tableExists accesses the super-global variable $GLOBALS.
Open

    public static function tableExists(string $tablename): bool
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        \trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}");
        $GLOBALS['xoopsLogger']->addDeprecated(
Severity: Minor
Found in class/Common/SysUtility.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

moveDoColumns accesses the super-global variable $GLOBALS.
Open

    private function moveDoColumns(): void
    {
        $tableName    = 'newbb_posts_text';
        $srcTableName = 'newbb_posts';
        if ($this->tableHandler->useTable($tableName)
Severity: Minor
Found in class/Common/Migrate.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

enumerate accesses the super-global variable $GLOBALS.
Open

    public static function enumerate(string $tableName, string $columnName): ?array
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);

        //    $result = $GLOBALS['xoopsDB']->query("SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
Severity: Minor
Found in class/Common/SysUtility.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

enumerate accesses the super-global variable $GLOBALS.
Open

    public static function enumerate(string $tableName, string $columnName): ?array
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);

        //    $result = $GLOBALS['xoopsDB']->query("SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
Severity: Minor
Found in class/Common/SysUtility.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

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): ?int
    {
        $newId = null;
        $tempTable = [];
        $table  = $GLOBALS['xoopsDB']->prefix($tableName);
Severity: Minor
Found in class/Common/SysUtility.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

The method truncateHtml() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
Open

    public static function truncateHtml(
        string $text,
        ?int $length = 100,
        string $ending = '...',
        bool $exact = false,
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

createElements accesses the super-global variable $GLOBALS.
Open

    public function createElements($obj)
    {
        $helper       = Helper::getInstance();
        $timeoffset   = null;
        $configurator = new Configurator();
Severity: Minor
Found in class/Form/ItemForm.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

createElements accesses the super-global variable $GLOBALS.
Open

    public function createElements($obj)
    {
        $helper       = Helper::getInstance();
        $timeoffset   = null;
        $configurator = new Configurator();
Severity: Minor
Found in class/Form/ItemForm.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

getCategoriesForSubmit accesses the super-global variable $GLOBALS.
Open

    public function &getCategoriesForSubmit()
    {
        global $theresult;
        $ret      = [];
        $criteria = new \CriteriaCompo();
Severity: Minor
Found in class/CategoryHandler.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

getSubCats accesses the super-global variable $GLOBALS.
Open

    public function getSubCats($categories)
    {
        $criteria = new \CriteriaCompo(new \Criteria('parentid', '(' . \implode(',', \array_keys($categories)) . ')', 'IN'));
        $ret      = [];
        if (!$this->publisherIsAdmin) {
Severity: Minor
Found in class/CategoryHandler.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

The method updateBlock() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
Open

    public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in class/Common/Blocksadmin.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

orderBlock accesses the super-global variable $GLOBALS.
Open

    public function orderBlock(
        array $bid,
        array $oldtitle,
        array $oldside,
        array $oldweight,
Severity: Minor
Found in class/Common/Blocksadmin.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

render accesses the super-global variable $GLOBALS.
Open

    public function render(?array $block = null)
    {
        \xoops_load('XoopsFormLoader');
        \xoops_loadLanguage('common', $this->moduleDirNameUpper);

Severity: Minor
Found in class/Common/Blocksadmin.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

rcopy accesses the super-global variable $GLOBALS.
Open

    public static function rcopy($src, $dest)
    {
        // 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 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

enumerate accesses the super-global variable $GLOBALS.
Open

    public static function enumerate(string $tableName, string $columnName): ?array
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);

        //    $result = $GLOBALS['xoopsDB']->query("SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
Severity: Minor
Found in class/Common/SysUtility.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

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): ?int
    {
        $newId = null;
        $tempTable = [];
        $table  = $GLOBALS['xoopsDB']->prefix($tableName);
Severity: Minor
Found in class/Common/SysUtility.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

deleteDirectory accesses the super-global variable $GLOBALS.
Open

    public static function deleteDirectory($src)
    {
        // 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 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

fieldExists accesses the super-global variable $GLOBALS.
Open

    public static function fieldExists(string $fieldname, string $table): bool
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        \trigger_error(__METHOD__ . " is deprecated, use Xmf\Database\Tables instead - instantiated from {$trace[0]['file']} line {$trace[0]['line']},");

Severity: Minor
Found in class/Common/SysUtility.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

tableExists accesses the super-global variable $GLOBALS.
Open

    public static function tableExists(string $tablename): bool
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        \trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}");
        $GLOBALS['xoopsLogger']->addDeprecated(
Severity: Minor
Found in class/Common/SysUtility.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

createElements accesses the super-global variable $GLOBALS.
Open

    public function createElements($obj)
    {
        $helper       = Helper::getInstance();
        $timeoffset   = null;
        $configurator = new Configurator();
Severity: Minor
Found in class/Form/ItemForm.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

Severity
Category
Status
Source
Language