mambax7/publisher

View on GitHub

Showing 3,032 of 3,032 total issues

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

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

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

__construct accesses the super-global variable $GLOBALS.
Open

    public function __construct($title, $name, $action, $method = 'post', $addtoken = false, $summary = '')
    {
        //        global $xoTheme;
        //        $GLOBALS['xoTheme']->addScript(PUBLISHER_URL . '/assets/js/ui.core.js');
        //        $GLOBALS['xoTheme']->addScript(PUBLISHER_URL . '/assets/js/ui.tabs.js');
Severity: Minor
Found in class/Form/ThemeTabForm.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

__construct accesses the super-global variable $GLOBALS.
Open

    public function __construct($title, $name, $action, $method = 'post', $addtoken = false, $summary = '')
    {
        //        global $xoTheme;
        //        $GLOBALS['xoTheme']->addScript(PUBLISHER_URL . '/assets/js/ui.core.js');
        //        $GLOBALS['xoTheme']->addScript(PUBLISHER_URL . '/assets/js/ui.tabs.js');
Severity: Minor
Found in class/Form/ThemeTabForm.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 getItemRating() has a Cyclomatic Complexity of 35. The configured cyclomatic complexity threshold is 10.
Open

    public function getItemRating($itemId = 0, $source = 0)
    {
        $helper = \XoopsModules\Publisher\Helper::getInstance();

        $itemRating               = [];
Severity: Minor
Found in class/RatingsHandler.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

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

    public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
    {
        $count            = 0;
        $ret              = [];
        $criteriaKeywords = $criteriaPermissions = $criteriaUser = null;
Severity: Minor
Found in class/ItemHandler.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

checkMimeTypes accesses the super-global variable $_FILES.
Open

    public function checkMimeTypes($postField)
    {
        $ret              = false;
        $allowedMimetypes = $this->getArrayByType();
        if (empty($allowedMimetypes)) {
Severity: Minor
Found in class/MimetypeHandler.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

add accesses the super-global variable $GLOBALS.
Open

    public static function add(): void
    {
        $helper = Helper::getInstance();
        /** @var MimetypeHandler $mimetypeHandler */
        $mimetypeHandler = $helper->getHandler('Mimetype');
Severity: Minor
Found in class/MimetypesUtility.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

search accesses the super-global variable $GLOBALS.
Open

    public static function search($icons): void
    {
        $helper = Helper::getInstance();
        /** @var MimetypeHandler $mimetypeHandler */
        $mimetypeHandler = $helper->getHandler('Mimetype');
Severity: Minor
Found in class/MimetypesUtility.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

getOtherImages accesses the super-global variable $GLOBALS.
Open

    public function getOtherImages($item = [])
    {
        $images         = $this->getImages();
        $item['images'] = [];
        $i              = 0;
Severity: Minor
Found in class/Item.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

getItemsFromSearch accesses the super-global variable $GLOBALS.
Open

    public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
    {
        $count            = 0;
        $ret              = [];
        $criteriaKeywords = $criteriaPermissions = $criteriaUser = null;
Severity: Minor
Found in class/ItemHandler.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

getObjects accesses the super-global variable $GLOBALS.
Open

    public function &getObjects(\CriteriaElement $criteria = null, $idKey = 'none', $as_object = true, $notNullFields = null)
    {
        $limit         = $start = 0;
        $ret           = [];
        $notNullFields = (null !== $notNullFields) ?: '';
Severity: Minor
Found in class/ItemHandler.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

getAdminLinks accesses the super-global variable $GLOBALS.
Open

    public function getAdminLinks($icons)
    {
        $adminLinks = '';
        if (\is_object($GLOBALS['xoopsUser'])
            && (Utility::userIsAdmin() || Utility::userIsAuthor($this)
Severity: Minor
Found in class/Item.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

convertForJapanese accesses the super-global variable $GLOBALS.
Open

    protected function convertForJapanese($str)
    {
        // no action, if not flag
        if (!\defined('_PUBLISHER_FLAG_JP_CONVERT')) {
            return $str;
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest(): void
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest(): void
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

manage accesses the super-global variable $GLOBALS.
Open

    public static function manage($icons): void
    {
        $helper  = Helper::getInstance();
        $utility = new Utility();
        /** @var MimetypeHandler $mimetypeHandler */
Severity: Minor
Found in class/MimetypesUtility.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 edit() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
Open

    public static function edit(): void
    {
        $helper = Helper::getInstance();
        /** @var MimetypeHandler $mimetypeHandler */
        $mimetypeHandler = $helper->getHandler('Mimetype');
Severity: Minor
Found in class/MimetypesUtility.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

getGrantedItems accesses the super-global variable $GLOBALS.
Open

    public function getGrantedItems($gpermName)
    {
        static $items;
        if (isset($items[$gpermName])) {
            return $items[$gpermName];
Severity: Minor
Found in class/PermissionHandler.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