mambax7/publisher

View on GitHub

Showing 3,032 of 3,032 total issues

tryBrowserCache accesses the super-global variable $_SERVER.
Open

    protected function tryBrowserCache()
    {
        if (BROWSER_CACHE_DISABLE) {
            $this->debug(3, 'Browser caching is disabled');

Severity: Minor
Found in thumb.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

serveErrors accesses the super-global variable $_SERVER.
Open

    protected function serveErrors()
    {
        header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
        if (!DISPLAY_ERROR_MESSAGES) {
            return;
Severity: Minor
Found in thumb.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

calcDocRoot accesses the super-global variable $_SERVER.
Open

    protected function calcDocRoot()
    {
        $docRoot = @$_SERVER['DOCUMENT_ROOT'];
        if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
            $docRoot = LOCAL_FILE_BASE_DIRECTORY;
Severity: Minor
Found in thumb.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

getLocalImagePath accesses the super-global variable $_SERVER.
Open

    protected function getLocalImagePath($src)
    {
        $src = ltrim($src, '/'); //strip off the leading '/'
        if (!$this->docRoot) {
            $this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
Severity: Minor
Found in thumb.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 function xoops_module_update_publisher() has a Cyclomatic Complexity of 21. The configured cyclomatic complexity threshold is 10.
Open

function xoops_module_update_publisher(\XoopsModule $module, ?string $previousVersion = null)
{
    //    global $GLOBALS['xoopsDB'];
    $moduleDirName = \basename(\dirname(__DIR__));
    //    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Severity: Minor
Found in include/onupdate.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

xoops_module_update_publisher accesses the super-global variable $GLOBALS.
Open

function xoops_module_update_publisher(\XoopsModule $module, ?string $previousVersion = null)
{
    //    global $GLOBALS['xoopsDB'];
    $moduleDirName = \basename(\dirname(__DIR__));
    //    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Severity: Minor
Found in include/onupdate.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 $_SERVER.
Open

    public function __construct()
    {
        global $allowedSites;
        $this->startTime = microtime(true);
        date_default_timezone_set('UTC');
Severity: Minor
Found in thumb.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

getCategoriesCount accesses the super-global variable $GLOBALS.
Open

    public function getCategoriesCount($parentid = 0)
    {
        if (-1 == $parentid) {
            return $this->getCount();
        }
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

getAllFiles accesses the super-global variable $GLOBALS.
Open

    public function getAllFiles($itemId = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = [])
    {
        $files = [];

        $this->table_link = $this->db->prefix($this->helper->getDirname() . '_items');
Severity: Minor
Found in class/FileHandler.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(): void
    {
        // require_once  \dirname(__DIR__, 2) . '/include/common.php';
        // Category
        $criteria = new \Criteria(null);
Severity: Minor
Found in class/Form/CategoryForm.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

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

publisher_latest_news_show accesses the super-global variable $GLOBALS.
Open

function publisher_latest_news_show($options)
{
    $block = [];

    $configurator = new Configurator();
Severity: Minor
Found in blocks/latest_news.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

getCategoriesCount accesses the super-global variable $GLOBALS.
Open

    public function getCategoriesCount($parentid = 0)
    {
        if (-1 == $parentid) {
            return $this->getCount();
        }
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 createSchemaFromSqlfile() has a Cyclomatic Complexity of 28. The configured cyclomatic complexity threshold is 10.
Open

    public function createSchemaFromSqlfile(): bool
    {
        if (!\is_file($this->fileSql)) {
            \xoops_error('Error: Sql file not found!');
            return false;
Severity: Minor
Found in class/Common/MigrateHelper.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

getFormFeedback accesses the super-global variable $GLOBALS.
Open

    public function getFormFeedback($action = false)
    {
        if (!$action) {
            $action = $_SERVER['REQUEST_URI'];
        }
Severity: Minor
Found in class/Common/ModuleFeedback.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

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(): void
    {
        // require_once  \dirname(__DIR__, 2) . '/include/common.php';
        // Category
        $criteria = new \Criteria(null);
Severity: Minor
Found in class/Form/CategoryForm.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