mambax7/songlist

View on GitHub
class/Utility.php

Summary

Maintainability
F
2 wks
Test Coverage

getIPData accesses the super-global variable $_REQUEST.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $_SERVER.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $_SERVER.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

getFilterElement accesses the super-global variable $_SERVER.
Open

    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
    {
        $components = static::getFilterURLComponents($filter, $field, $sort);
        $ele        = false;
        require_once \dirname(__DIR__) . '/include/songlist.object.php';
Severity: Minor
Found in class/Utility.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

getFilterElement accesses the super-global variable $_SERVER.
Open

    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
    {
        $components = static::getFilterURLComponents($filter, $field, $sort);
        $ele        = false;
        require_once \dirname(__DIR__) . '/include/songlist.object.php';
Severity: Minor
Found in class/Utility.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

getFilterElement accesses the super-global variable $_SERVER.
Open

    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
    {
        $components = static::getFilterURLComponents($filter, $field, $sort);
        $ele        = false;
        require_once \dirname(__DIR__) . '/include/songlist.object.php';
Severity: Minor
Found in class/Utility.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

getFilterURLComponents accesses the super-global variable $_REQUEST.
Open

    public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
    {
        $parts     = \explode('|', $filter);
        $ret       = [];
        $value     = '';
Severity: Minor
Found in class/Utility.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

getFilterURLComponents accesses the super-global variable $_REQUEST.
Open

    public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
    {
        $parts     = \explode('|', $filter);
        $ret       = [];
        $value     = '';
Severity: Minor
Found in class/Utility.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

getToken accesses the super-global variable $GLOBALS.
Open

    public static function getToken()
    {
        $sql    = 'SELECT md5(rand()/rand()*rand()/rand()*rand()*rand()/rand()*rand()) as `salt`';
        $result = $GLOBALS['xoopsDB']->queryF($sql);
        [$salt] = $GLOBALS['xoopsDB']->fetchRow($result);
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $_SERVER.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $GLOBALS.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

getFilterElement accesses the super-global variable $_SERVER.
Open

    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
    {
        $components = static::getFilterURLComponents($filter, $field, $sort);
        $ele        = false;
        require_once \dirname(__DIR__) . '/include/songlist.object.php';
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $GLOBALS.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

getFilterURLComponents accesses the super-global variable $_REQUEST.
Open

    public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
    {
        $parts     = \explode('|', $filter);
        $ret       = [];
        $value     = '';
Severity: Minor
Found in class/Utility.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

getToken accesses the super-global variable $GLOBALS.
Open

    public static function getToken()
    {
        $sql    = 'SELECT md5(rand()/rand()*rand()/rand()*rand()*rand()/rand()*rand()) as `salt`';
        $result = $GLOBALS['xoopsDB']->queryF($sql);
        [$salt] = $GLOBALS['xoopsDB']->fetchRow($result);
Severity: Minor
Found in class/Utility.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

getFilterElement accesses the super-global variable $_SERVER.
Open

    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
    {
        $components = static::getFilterURLComponents($filter, $field, $sort);
        $ele        = false;
        require_once \dirname(__DIR__) . '/include/songlist.object.php';
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $_REQUEST.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

getFilterElement accesses the super-global variable $_SERVER.
Open

    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
    {
        $components = static::getFilterURLComponents($filter, $field, $sort);
        $ele        = false;
        require_once \dirname(__DIR__) . '/include/songlist.object.php';
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $GLOBALS.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $_SERVER.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

getFilterElement accesses the super-global variable $_SERVER.
Open

    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
    {
        $components = static::getFilterURLComponents($filter, $field, $sort);
        $ele        = false;
        require_once \dirname(__DIR__) . '/include/songlist.object.php';
Severity: Minor
Found in class/Utility.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

getFilterURLComponents accesses the super-global variable $_REQUEST.
Open

    public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
    {
        $parts     = \explode('|', $filter);
        $ret       = [];
        $value     = '';
Severity: Minor
Found in class/Utility.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

getFilterURLComponents accesses the super-global variable $_REQUEST.
Open

    public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
    {
        $parts     = \explode('|', $filter);
        $ret       = [];
        $value     = '';
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

getIPData accesses the super-global variable $GLOBALS.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Minor
Found in class/Utility.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

getFilterElement accesses the super-global variable $_SERVER.
Open

    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
    {
        $components = static::getFilterURLComponents($filter, $field, $sort);
        $ele        = false;
        require_once \dirname(__DIR__) . '/include/songlist.object.php';
Severity: Minor
Found in class/Utility.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

getFilterURLComponents accesses the super-global variable $_REQUEST.
Open

    public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
    {
        $parts     = \explode('|', $filter);
        $ret       = [];
        $value     = '';
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

shortenUrl accesses the super-global variable $GLOBALS.
Open

    public static function shortenUrl($url)
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = \xoops_getHandler('module');
        /** @var \XoopsConfigHandler $configHandler */
Severity: Minor
Found in class/Utility.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

Function xml2array has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
Open

    public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
    {
        if (!$contents) {
            return [];
        }
Severity: Minor
Found in class/Utility.php - About 1 day 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

File Utility.php has 609 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);

namespace XoopsModules\Songlist;

use Xmf\Request;
Severity: Major
Found in class/Utility.php - About 1 day to fix

    Method getFilterElement has 178 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
        {
            $components = static::getFilterURLComponents($filter, $field, $sort);
            $ele        = false;
            require_once \dirname(__DIR__) . '/include/songlist.object.php';
    Severity: Major
    Found in class/Utility.php - About 7 hrs to fix

      Method xml2array has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
          {
              if (!$contents) {
                  return [];
              }
      Severity: Major
      Found in class/Utility.php - About 3 hrs to fix

        The class Utility has an overall complexity of 149 which is very high. The configured complexity threshold is 50.
        Open

        class Utility extends Common\SysUtility
        {
            //--------------- Custom module methods -----------------------------
            /**
             * Function responsible for checking if a directory exists, we can also write in and create an index.html file
        Severity: Minor
        Found in class/Utility.php by phpmd

        Function checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
            {
                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                $update             = '';
        Severity: Minor
        Found in class/Utility.php - About 2 hrs 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 getIPData has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getIPData($ip = false): array
            {
                $ret = [];
                if (\is_object($GLOBALS['xoopsUser'])) {
                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
        Severity: Major
        Found in class/Utility.php - About 2 hrs to fix

          Function getFilterElement has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
              {
                  $components = static::getFilterURLComponents($filter, $field, $sort);
                  $ele        = false;
                  require_once \dirname(__DIR__) . '/include/songlist.object.php';
          Severity: Minor
          Found in class/Utility.php - About 1 hr 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 getIPData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getIPData($ip = false): array
              {
                  $ret = [];
                  if (\is_object($GLOBALS['xoopsUser'])) {
                      $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
          Severity: Minor
          Found in class/Utility.php - About 1 hr 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 checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
              {
                  $moduleDirName      = \basename(\dirname(__DIR__, 2));
                  $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                  $update             = '';
          Severity: Minor
          Found in class/Utility.php - About 1 hr to fix

            Function getFilterURLComponents has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
                {
                    $parts     = \explode('|', $filter);
                    $ret       = [];
                    $value     = '';
            Severity: Minor
            Found in class/Utility.php - About 1 hr 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 toXml has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function toXml($array, $name, $standalone, $beginning, $nested): string
                {
                    $output = '';
                    if ($beginning) {
                        if ($standalone) {
            Severity: Minor
            Found in class/Utility.php - About 1 hr 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 toXml has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function toXml($array, $name, $standalone, $beginning, $nested): string
                {
                    $output = '';
                    if ($beginning) {
                        if ($standalone) {
            Severity: Minor
            Found in class/Utility.php - About 1 hr to fix

              Method getFilterURLComponents has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
                  {
                      $parts     = \explode('|', $filter);
                      $ret       = [];
                      $value     = '';
              Severity: Minor
              Found in class/Utility.php - About 1 hr to fix

                Method shortenUrl has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function shortenUrl($url)
                    {
                        /** @var \XoopsModuleHandler $moduleHandler */
                        $moduleHandler = \xoops_getHandler('module');
                        /** @var \XoopsConfigHandler $configHandler */
                Severity: Minor
                Found in class/Utility.php - About 1 hr to fix

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

                      public static function shortenUrl($url)
                      {
                          /** @var \XoopsModuleHandler $moduleHandler */
                          $moduleHandler = \xoops_getHandler('module');
                          /** @var \XoopsConfigHandler $configHandler */
                  Severity: Minor
                  Found in class/Utility.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 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function recurseCopy($src, $dst): void
                      {
                          $dir = \opendir($src);
                          //    @mkdir($dst);
                          while (false !== ($file = \readdir($dir))) {
                  Severity: Minor
                  Found in class/Utility.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 getFilterElement has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
                  Severity: Minor
                  Found in class/Utility.php - About 35 mins to fix

                    Method toXml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static function toXml($array, $name, $standalone, $beginning, $nested): string
                    Severity: Minor
                    Found in class/Utility.php - About 35 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $url;
                      Severity: Major
                      Found in class/Utility.php - About 30 mins to fix

                        The method getFilterElement() has 182 lines of code. Current threshold is set to 100. Avoid really long methods.
                        Open

                            public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
                            {
                                $components = static::getFilterURLComponents($filter, $field, $sort);
                                $ele        = false;
                                require_once \dirname(__DIR__) . '/include/songlist.object.php';
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        The method xml2array() has an NPath complexity of 2648. The configured NPath complexity threshold is 200.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        NPathComplexity

                        Since: 0.1

                        The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                        Example

                        class Foo {
                            function bar() {
                                // lots of complicated code
                            }
                        }

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

                        The method xml2array() has 128 lines of code. Current threshold is set to 100. Avoid really long methods.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

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

                            public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                            {
                                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                                $update             = '';
                        Severity: Minor
                        Found in class/Utility.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 xml2array() has a Cyclomatic Complexity of 31. The configured cyclomatic complexity threshold is 10.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.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 getFilterElement() has a Cyclomatic Complexity of 42. The configured cyclomatic complexity threshold is 10.
                        Open

                            public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
                            {
                                $components = static::getFilterURLComponents($filter, $field, $sort);
                                $ele        = false;
                                require_once \dirname(__DIR__) . '/include/songlist.object.php';
                        Severity: Minor
                        Found in class/Utility.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 toXml() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
                        Open

                            public static function toXml($array, $name, $standalone, $beginning, $nested): string
                            {
                                $output = '';
                                if ($beginning) {
                                    if ($standalone) {
                        Severity: Minor
                        Found in class/Utility.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

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

                                                $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $repeated_tag_index[$tag . '_' . $level]++;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                        $current[$tag]['0_attr'] = $current[$tag . '_attr'];
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $repeated_tag_index[$tag . '_' . $level] = 1;
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                                $repeated_tag_index[$tag . '_' . $level] = 1;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            $current[$tag] = $result;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag]                           = [$current[$tag], $result]; //This will combine the existing item and the new item together to make an array
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                        unset($current[$tag . '_attr']);
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            $repeated_tag_index[$tag . '_' . $level] = 1;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            $current = &$current[$tag];
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            if (isset($current[$tag][0]) and \is_array($current[$tag])) {//If it is already an array...
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                    $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                        $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.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 '$parent' which will lead to PHP notices.
                        Open

                                        $current = &$parent[$level - 1];
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                        $current = &$parent[$level - 1];
                        Severity: Minor
                        Found in class/Utility.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 '$value' which will lead to PHP notices.
                        Open

                                            $result['value'] = $value;
                        Severity: Minor
                        Found in class/Utility.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 '$parent' which will lead to PHP notices.
                        Open

                                        $parent[$level - 1] = &$current;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag]                           = [$current[$tag], $result]; //...Make it an array using the existing value and the new value
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                                        $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag]                           = [$current[$tag], $result]; //This will combine the existing item and the new item together to make an array
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                    $current[$tag]['0_attr'] = $current[$tag . '_attr'];
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                                $repeated_tag_index[$tag . '_' . $level] = 2;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                        if (!\is_array($current) or (!\array_key_exists($tag, $current))) { //Insert New tag
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                                $repeated_tag_index[$tag . '_' . $level]++;
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                            $last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                    $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            $repeated_tag_index[$tag . '_' . $level] = 1;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                if (isset($current[$tag . '_attr'])) { //The attribute of the last(0th) tag must be moved as well
                        Severity: Minor
                        Found in class/Utility.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 '$type' which will lead to PHP notices.
                        Open

                                    } elseif ('complete' === $type) { //Tags that ends in 1 line '<tag>'
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            $repeated_tag_index[$tag . '_' . $level]++;
                        Severity: Minor
                        Found in class/Utility.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 '$value' which will lead to PHP notices.
                        Open

                                    unset($attributes, $value); //Remove existing values, or there will be trouble
                        Severity: Minor
                        Found in class/Utility.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 '$value' which will lead to PHP notices.
                        Open

                                            $result = $value;
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                        $parent[$level - 1] = &$current;
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                                $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $repeated_tag_index[$tag . '_' . $level] = 2;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                    if (isset($current[$tag . '_attr'])) { //The attribute of the last(0th) tag must be moved as well
                        Severity: Minor
                        Found in class/Utility.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 '$type' which will lead to PHP notices.
                        Open

                                    } elseif ('close' === $type) { //End of tag '</tag>'
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                        if (isset($current[$tag])) { //If taken, put all things inside a list(array)
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                                    $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            $last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            $current         = &$current[$tag][$last_item_index];
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag]                           = [$current[$tag], $result]; //...Make it an array using the existing value and the new value
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                        $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            $current[$tag]                           = $result;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                        $current[$tag]['0_attr'] = $current[$tag . '_attr'];
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            if (isset($current[$tag][0]) and \is_array($current[$tag])) {//If it is already an array...
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                                $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                    $current[$tag]['0_attr'] = $current[$tag . '_attr'];
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                            $repeated_tag_index[$tag . '_' . $level]++;
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                            $repeated_tag_index[$tag . '_' . $level] = 1;
                        Severity: Minor
                        Found in class/Utility.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 '$value' which will lead to PHP notices.
                        Open

                                    if (isset($value)) {
                        Severity: Minor
                        Found in class/Utility.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 '$type' which will lead to PHP notices.
                        Open

                                    if ('open' === $type) {//The starting of the tag '<tag>'
                        Severity: Minor
                        Found in class/Utility.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 '$level' which will lead to PHP notices.
                        Open

                                            $repeated_tag_index[$tag . '_' . $level] = 1;
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                            if (isset($current[$tag][0])) {//If there is a 0th element it is already an array
                        Severity: Minor
                        Found in class/Utility.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 '$tag' which will lead to PHP notices.
                        Open

                                                    unset($current[$tag . '_attr']);
                        Severity: Minor
                        Found in class/Utility.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

                        The class Utility has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13.
                        Open

                        class Utility extends Common\SysUtility
                        {
                            //--------------- Custom module methods -----------------------------
                            /**
                             * Function responsible for checking if a directory exists, we can also write in and create an index.html file
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CouplingBetweenObjects

                        Since: 1.1.0

                        A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                        Example

                        class Foo {
                            /**
                             * @var \foo\bar\X
                             */
                            private $x = null;
                        
                            /**
                             * @var \foo\bar\Y
                             */
                            private $y = null;
                        
                            /**
                             * @var \foo\bar\Z
                             */
                            private $z = null;
                        
                            public function setFoo(\Foo $foo) {}
                            public function setBar(\Bar $bar) {}
                            public function setBaz(\Baz $baz) {}
                        
                            /**
                             * @return \SplObjectStorage
                             * @throws \OutOfRangeException
                             * @throws \InvalidArgumentException
                             * @throws \ErrorException
                             */
                            public function process(\Iterator $it) {}
                        
                            // ...
                        }

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

                        Remove error control operator '@' on line 241.
                        Open

                            public static function getIPData($ip = false): array
                            {
                                $ret = [];
                                if (\is_object($GLOBALS['xoopsUser'])) {
                                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ErrorControlOperator

                        Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                        Example

                        function foo($filePath) {
                            $file = @fopen($filPath); // hides exceptions
                            $key = @$array[$notExistingKey]; // assigns null to $key
                        }

                        Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

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

                            public static function getIPData($ip = false): array
                        Severity: Minor
                        Found in class/Utility.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

                        Remove error control operator '@' on line 272.
                        Open

                            public static function getIPData($ip = false): array
                            {
                                $ret = [];
                                if (\is_object($GLOBALS['xoopsUser'])) {
                                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ErrorControlOperator

                        Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                        Example

                        function foo($filePath) {
                            $file = @fopen($filPath); // hides exceptions
                            $key = @$array[$notExistingKey]; // assigns null to $key
                        }

                        Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                        Missing class import via use statement (line '469', column '28').
                        Open

                                        $ele = new \XoopsFormElementTray('');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '471', column '31').
                        Open

                                        $button = new \XoopsFormButton('', 'button_' . $field . '', '[+]');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '470', column '38').
                        Open

                                        $ele->addElement(new \XoopsFormText('', 'filter_' . $field . '', 11, 40, $components['value']));
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Remove error control operator '@' on line 240.
                        Open

                            public static function getIPData($ip = false): array
                            {
                                $ret = [];
                                if (\is_object($GLOBALS['xoopsUser'])) {
                                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ErrorControlOperator

                        Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                        Example

                        function foo($filePath) {
                            $file = @fopen($filPath); // hides exceptions
                            $key = @$array[$notExistingKey]; // assigns null to $key
                        }

                        Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                        Remove error control operator '@' on line 273.
                        Open

                            public static function getIPData($ip = false): array
                            {
                                $ret = [];
                                if (\is_object($GLOBALS['xoopsUser'])) {
                                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ErrorControlOperator

                        Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                        Example

                        function foo($filePath) {
                            $file = @fopen($filPath); // hides exceptions
                            $key = @$array[$notExistingKey]; // assigns null to $key
                        }

                        Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                        Remove error control operator '@' on line 254.
                        Open

                            public static function getIPData($ip = false): array
                            {
                                $ret = [];
                                if (\is_object($GLOBALS['xoopsUser'])) {
                                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ErrorControlOperator

                        Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                        Example

                        function foo($filePath) {
                            $file = @fopen($filPath); // hides exceptions
                            $key = @$array[$notExistingKey]; // assigns null to $key
                        }

                        Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                        Remove error control operator '@' on line 255.
                        Open

                            public static function getIPData($ip = false): array
                            {
                                $ret = [];
                                if (\is_object($GLOBALS['xoopsUser'])) {
                                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ErrorControlOperator

                        Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                        Example

                        function foo($filePath) {
                            $file = @fopen($filPath); // hides exceptions
                            $key = @$array[$notExistingKey]; // assigns null to $key
                        }

                        Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                        Missing class import via use statement (line '40', column '31').
                        Open

                                            throw new \RuntimeException(\sprintf('Unable to create the %s directory', $folder));
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        The method getIPData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                    } else {
                                        $ret['ip4'] = true;
                                        $ret['ip6'] = false;
                                    }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method obj2array uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                    } else {
                                        $ret[$key] = $value;
                                    }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        Avoid assigning values to variables in if clauses and the like (line '573', column '18').
                        Open

                            public static function shortenUrl($url)
                            {
                                /** @var \XoopsModuleHandler $moduleHandler */
                                $moduleHandler = \xoops_getHandler('module');
                                /** @var \XoopsConfigHandler $configHandler */
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        IfStatementAssignment

                        Since: 2.7.0

                        Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($foo = 'bar') { // possible typo
                                    // ...
                                }
                                if ($baz = 0) { // always false
                                    // ...
                                }
                            }
                        }

                        Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                        Avoid using static access to class '\XoopsModule' in method 'checkVerPhp'.
                        Open

                                    $module = \XoopsModule::getByDirname($moduleDirName);
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        StaticAccess

                        Since: 1.4.0

                        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                        Example

                        class Foo
                        {
                            public function bar()
                            {
                                Bar::baz();
                            }
                        }

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

                        Avoid using static access to class '\Xmf\Request' in method 'getIPData'.
                        Open

                                } elseif (Request::hasVar('HTTP_X_FORWARDED_FOR', 'SERVER')) {
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        StaticAccess

                        Since: 1.4.0

                        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                        Example

                        class Foo
                        {
                            public function bar()
                            {
                                Bar::baz();
                            }
                        }

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

                        The method getIPData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                    } else {
                                        $ret['ip4']       = true;
                                        $ret['proxy-ip4'] = true;
                                        $ret['ip6']       = false;
                                        $ret['proxy-ip6'] = false;
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method getIPData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                } else {
                                    $ret['is_proxied']   = false;
                                    $ip                  = $_SERVER['REMOTE_ADDR'];
                                    $ret['network-addy'] = @\gethostbyaddr($ip);
                                    $ret['long']         = @\ip2long($ip);
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method getIPData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                    } else {
                                        $ret['ip4'] = true;
                                        $ret['ip6'] = false;
                                    }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method recurseCopy uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                        } else {
                                            \copy($src . '/' . $file, $dst . '/' . $file);
                                        }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method getIPData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                } else {
                                    $ret['uid']   = 0;
                                    $ret['uname'] = ($_REQUEST['uname'] ?? '');
                                    $ret['email'] = ($_REQUEST['email'] ?? '');
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method checkVerModule uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                        } else {
                                            $file              = json_decode($curlReturn, false);
                                            $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? \reset($file)->tag_name : $default);
                                            $latestVersion     = $file[0]->tag_name;
                                            $prerelease        = $file[0]->prerelease;
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        Avoid using static access to class '\XoopsModule' in method 'checkVerXoops'.
                        Open

                                    $module = \XoopsModule::getByDirname($moduleDirName);
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        StaticAccess

                        Since: 1.4.0

                        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                        Example

                        class Foo
                        {
                            public function bar()
                            {
                                Bar::baz();
                            }
                        }

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

                        Avoid using static access to class '\Xmf\Request' in method 'getFilterURLComponents'.
                        Open

                                $pagenav['limit'] = Request::getInt('limit', 30, 'REQUEST');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        StaticAccess

                        Since: 1.4.0

                        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                        Example

                        class Foo
                        {
                            public function bar()
                            {
                                Bar::baz();
                            }
                        }

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

                        The method xml2array uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                        } else { //There was another element with the same tag name
                                            if (isset($current[$tag][0])) {//If there is a 0th element it is already an array
                                                $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
                                                $repeated_tag_index[$tag . '_' . $level]++;
                                            } else {//This section will make the value an array if multiple tags with the same name appear together
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method xml2array uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                            } else {//This section will make the value an array if multiple tags with the same name appear together
                                                $current[$tag]                           = [$current[$tag], $result]; //This will combine the existing item and the new item together to make an array
                                                $repeated_tag_index[$tag . '_' . $level] = 2;
                        
                                                if (isset($current[$tag . '_attr'])) { //The attribute of the last(0th) tag must be moved as well
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        Avoid assigning values to variables in if clauses and the like (line '151', column '61').
                        Open

                            public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                            {
                                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                                $update             = '';
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        IfStatementAssignment

                        Since: 2.7.0

                        Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($foo = 'bar') { // possible typo
                                    // ...
                                }
                                if ($baz = 0) { // always false
                                    // ...
                                }
                            }
                        }

                        Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                        The method xml2array uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                            } else {
                                                $result['attr'][$attr] = $val;
                                            } //Set all the attributes in an array called 'attr'
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method xml2array uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                        } else {
                                            $result['value'] = $value;
                                        } //Put the value in an assoc array if we are in the 'Attribute' mode
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method xml2array uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                            } else { //If it is not an array...
                                                $current[$tag]                           = [$current[$tag], $result]; //...Make it an array using the existing value and the new value
                                                $repeated_tag_index[$tag . '_' . $level] = 1;
                                                if ('tag' === $priority and $get_attributes) {
                                                    if (isset($current[$tag . '_attr'])) { //The attribute of the last(0th) tag must be moved as well
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        The method xml2array uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                        Open

                                        } else { //New Key
                                            $current[$tag]                           = $result;
                                            $repeated_tag_index[$tag . '_' . $level] = 1;
                                            if ('tag' === $priority and $attributes_data) {
                                                $current[$tag . '_attr'] = $attributes_data;
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        ElseExpression

                        Since: 1.4.0

                        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($flag) {
                                    // one branch
                                } else {
                                    // another branch
                                }
                            }
                        }

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

                        Avoid unused parameters such as '$fct'.
                        Open

                            public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

                        Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

                        Avoid unused local variables such as '$opened_tags'.
                        Open

                                $opened_tags = [];
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        UnusedLocalVariable

                        Since: 0.2

                        Detects when a local variable is declared and/or assigned, but not used.

                        Example

                        class Foo {
                            public function doSomething()
                            {
                                $i = 5; // Unused
                            }
                        }

                        Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                        Avoid unused local variables such as '$arr'.
                        Open

                                $arr         = [];
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        UnusedLocalVariable

                        Since: 0.2

                        Detects when a local variable is declared and/or assigned, but not used.

                        Example

                        class Foo {
                            public function doSomething()
                            {
                                $i = 5; // Unused
                            }
                        }

                        Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                        Avoid unused local variables such as '$parents'.
                        Open

                                $parents     = [];
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        UnusedLocalVariable

                        Since: 0.2

                        Detects when a local variable is declared and/or assigned, but not used.

                        Example

                        class Foo {
                            public function doSomething()
                            {
                                $i = 5; // Unused
                            }
                        }

                        Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                        TODO found
                        Open

                                        \curl_setopt($curlHandle, \CURLOPT_SSL_VERIFYPEER, true); //TODO: how to avoid an error when 'Peer's Certificate issuer is not recognized'
                        Severity: Minor
                        Found in class/Utility.php by fixme

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                            public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                            {
                                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                                $update             = '';
                        Severity: Major
                        Found in class/Utility.php and 1 other location - About 3 days to fix
                        class/Common/VersionChecks.php on lines 94..144

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 647.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                            public static function checkVerPhp(\XoopsModule $module = null): bool
                            {
                                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                                if (null === $module) {
                        Severity: Major
                        Found in class/Utility.php and 1 other location - About 7 hrs to fix
                        class/Common/VersionChecks.php on lines 62..86

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 227.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                                    case 'abid':
                                        if ('albums' !== $op) {
                                            $ele = new SelectAlbumForm('', 'filter_' . $field . '', $components['value'], 1, false);
                                            $ele->setExtra(
                                                'onchange="window.open(\''
                        Severity: Major
                        Found in class/Utility.php and 5 other locations - About 3 hrs to fix
                        class/Utility.php on lines 319..338
                        class/Utility.php on lines 339..358
                        class/Utility.php on lines 359..378
                        class/Utility.php on lines 417..436
                        class/Utility.php on lines 437..456

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 156.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                                    case 'sid':
                                        if ('songs' !== $op) {
                                            $ele = new SelectSongForm('', 'filter_' . $field . '', $components['value'], 1, false);
                                            $ele->setExtra(
                                                'onchange="window.open(\''
                        Severity: Major
                        Found in class/Utility.php and 5 other locations - About 3 hrs to fix
                        class/Utility.php on lines 319..338
                        class/Utility.php on lines 339..358
                        class/Utility.php on lines 359..378
                        class/Utility.php on lines 397..416
                        class/Utility.php on lines 417..436

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 156.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                                    case 'gid':
                                        if ('genre' !== $op) {
                                            $ele = new SelectGenreForm('', 'filter_' . $field . '', $components['value'], 1, false);
                                            $ele->setExtra(
                                                'onchange="window.open(\''
                        Severity: Major
                        Found in class/Utility.php and 5 other locations - About 3 hrs to fix
                        class/Utility.php on lines 339..358
                        class/Utility.php on lines 359..378
                        class/Utility.php on lines 397..416
                        class/Utility.php on lines 417..436
                        class/Utility.php on lines 437..456

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 156.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                                    case 'vcid':
                                        if ('voice' !== $op) {
                                            $ele = new SelectVoiceForm('', 'filter_' . $field . '', $components['value'], 1, false);
                                            $ele->setExtra(
                                                'onchange="window.open(\''
                        Severity: Major
                        Found in class/Utility.php and 5 other locations - About 3 hrs to fix
                        class/Utility.php on lines 319..338
                        class/Utility.php on lines 359..378
                        class/Utility.php on lines 397..416
                        class/Utility.php on lines 417..436
                        class/Utility.php on lines 437..456

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 156.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                                    case 'cid':
                                        if ('category' !== $op) {
                                            $ele = new SelectCategoryForm('', 'filter_' . $field . '', $components['value'], 1, false);
                                            $ele->setExtra(
                                                'onchange="window.open(\''
                        Severity: Major
                        Found in class/Utility.php and 5 other locations - About 3 hrs to fix
                        class/Utility.php on lines 319..338
                        class/Utility.php on lines 339..358
                        class/Utility.php on lines 397..416
                        class/Utility.php on lines 417..436
                        class/Utility.php on lines 437..456

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 156.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                                    case 'aid':
                                        if ('artists' !== $op) {
                                            $ele = new SelectArtistForm('', 'filter_' . $field . '', $components['value'], 1, false);
                                            $ele->setExtra(
                                                'onchange="window.open(\''
                        Severity: Major
                        Found in class/Utility.php and 5 other locations - About 3 hrs to fix
                        class/Utility.php on lines 319..338
                        class/Utility.php on lines 339..358
                        class/Utility.php on lines 359..378
                        class/Utility.php on lines 397..416
                        class/Utility.php on lines 437..456

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 156.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                while (false !== ($file = \readdir($dir))) {
                                    if (('.' !== $file) && ('..' !== $file)) {
                                        if (\is_dir($src . '/' . $file)) {
                                            self::recurseCopy($src . '/' . $file, $dst . '/' . $file);
                                        } else {
                        Severity: Major
                        Found in class/Utility.php and 1 other location - About 1 hr to fix
                        class/Common/FilesManagement.php on lines 68..76

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 120.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                            public static function isIpv6($ip = ''): bool
                        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

                        The parameter $get_attributes is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseParameterName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name parameters.

                        Example

                        class ClassName {
                            public function doSomething($user_name) {
                            }
                        }

                        Source

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

                                    if (!$ch = \curl_init($source_url)) {
                        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 $ip. Configured minimum length is 3.
                        Open

                            public static function getIPData($ip = false): array
                        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 $op. Configured minimum length is 3.
                        Open

                            public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
                        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

                        There must be one USE keyword per declaration
                        Open

                        use XoopsModules\Songlist\Form\{
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 122 characters
                        Open

                                        $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum));
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 134 characters
                        Open

                            public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 135 characters
                        Open

                                            $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status'));
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 149 characters
                        Open

                                return ['value' => $ele_value, 'field' => $field, 'operator' => $operator, 'filter' => \implode('|', $ret), 'extra' => \implode('&', $retb)];
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 257 characters
                        Open

                                    $source_url = $GLOBALS['songlistModuleConfig']['bitly_apiurl'] . '/shorten?login=' . $GLOBALS['songlistModuleConfig']['bitly_username'] . '&apiKey=' . $GLOBALS['songlistModuleConfig']['bitly_apikey'] . '&format=json&longUrl=' . \urlencode($url);
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 154 characters
                        Open

                                        \curl_setopt($curlHandle, \CURLOPT_SSL_VERIFYPEER, true); //TODO: how to avoid an error when 'Peer's Certificate issuer is not recognized'
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 125 characters
                        Open

                                                    if (isset($current[$tag . '_attr'])) { //The attribute of the last(0th) tag must be moved as well
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 158 characters
                        Open

                                                $current[$tag]                           = [$current[$tag], $result]; //...Make it an array using the existing value and the new value
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 211 characters
                        Open

                                            $output .= \str_repeat("\t", (int)$nested) . '  <' . (\is_string($key) ? $key : $name . '_' . $key) . '>' . \trim($value) . '</' . (\is_string($key) ? $key : $name . '_' . $key) . '>' . "\n";
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 123 characters
                        Open

                                            } else {//This section will make the value an array if multiple tags with the same name appear together
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 121 characters
                        Open

                                                if (isset($current[$tag . '_attr'])) { //The attribute of the last(0th) tag must be moved as well
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 134 characters
                        Open

                                    $cookies    = XOOPS_ROOT_PATH . '/uploads/songlist_' . \md5($GLOBALS['songlistModuleConfig']['bitly_apikey']) . '.cookie';
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 133 characters
                        Open

                                if (!empty($GLOBALS['songlistModuleConfig']['bitly_username']) && !empty($GLOBALS['songlistModuleConfig']['bitly_apikey'])) {
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 143 characters
                        Open

                                            $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? \reset($file)->tag_name : $default);
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 174 characters
                        Open

                                                $current[$tag]                           = [$current[$tag], $result]; //This will combine the existing item and the new item together to make an array
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 131 characters
                        Open

                                            $output .= \str_repeat("\t", (int)$nested) . '<' . (\is_string($key) ? $key : $name . '_' . $key) . '>' . "\n";
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        Line exceeds 120 characters; contains 132 characters
                        Open

                                            $output .= \str_repeat("\t", (int)$nested) . '</' . (\is_string($key) ? $key : $name . '_' . $key) . '>' . "\n";
                        Severity: Minor
                        Found in class/Utility.php by phpcodesniffer

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $xml_array is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $ele_value is not named in camelCase.
                        Open

                            public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
                            {
                                $parts     = \explode('|', $filter);
                                $ret       = [];
                                $value     = '';
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $ele_value is not named in camelCase.
                        Open

                            public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
                            {
                                $parts     = \explode('|', $filter);
                                $ret       = [];
                                $value     = '';
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $xml_values is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $xml_array is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $get_attributes is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $last_item_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $get_attributes is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $proxy_ip is not named in camelCase.
                        Open

                            public static function getIPData($ip = false): array
                            {
                                $ret = [];
                                if (\is_object($GLOBALS['xoopsUser'])) {
                                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $xml_values is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $source_url is not named in camelCase.
                        Open

                            public static function shortenUrl($url)
                            {
                                /** @var \XoopsModuleHandler $moduleHandler */
                                $moduleHandler = \xoops_getHandler('module');
                                /** @var \XoopsConfigHandler $configHandler */
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $get_attributes is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $opened_tags is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $last_item_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $proxy_ip is not named in camelCase.
                        Open

                            public static function getIPData($ip = false): array
                            {
                                $ret = [];
                                if (\is_object($GLOBALS['xoopsUser'])) {
                                    $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $source_url is not named in camelCase.
                        Open

                            public static function shortenUrl($url)
                            {
                                /** @var \XoopsModuleHandler $moduleHandler */
                                $moduleHandler = \xoops_getHandler('module');
                                /** @var \XoopsConfigHandler $configHandler */
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $ele_value is not named in camelCase.
                        Open

                            public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
                            {
                                $parts     = \explode('|', $filter);
                                $ret       = [];
                                $value     = '';
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $xml_values is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $repeated_tag_index is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $xml_array is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        The variable $attributes_data is not named in camelCase.
                        Open

                            public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                            {
                                if (!$contents) {
                                    return [];
                                }
                        Severity: Minor
                        Found in class/Utility.php by phpmd

                        CamelCaseVariableName

                        Since: 0.2

                        It is considered best practice to use the camelCase notation to name variables.

                        Example

                        class ClassName {
                            public function doSomething() {
                                $data_module = new DataModule();
                            }
                        }

                        Source

                        There are no issues that match your filters.

                        Category
                        Status