mambax7/extgallery

View on GitHub
admin/blocksadmin.php

Summary

Maintainability
F
4 days
Test Coverage

isBlockCloned accesses the super-global variable $GLOBALS.
Open

    function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
    {
        xoops_loadLanguage('admin', 'system');
        xoops_loadLanguage('admin/blocksadmin', 'system');
        xoops_loadLanguage('admin/groups', 'system');
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

listBlocks accesses the super-global variable $_SERVER.
Open

    function listBlocks()
    {
        global $xoopsModule, $pathIcon16;
        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
        $moduleDirName      = \basename(\dirname(__DIR__));
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

listBlocks accesses the super-global variable $GLOBALS.
Open

    function listBlocks()
    {
        global $xoopsModule, $pathIcon16;
        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
        $moduleDirName      = \basename(\dirname(__DIR__));
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $GLOBALS.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

isBlockCloned accesses the super-global variable $GLOBALS.
Open

    function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
    {
        xoops_loadLanguage('admin', 'system');
        xoops_loadLanguage('admin/blocksadmin', 'system');
        xoops_loadLanguage('admin/groups', 'system');
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateBlock accesses the super-global variable $_SERVER.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

listBlocks accesses the super-global variable $GLOBALS.
Open

    function listBlocks()
    {
        global $xoopsModule, $pathIcon16;
        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
        $moduleDirName      = \basename(\dirname(__DIR__));
Severity: Minor
Found in admin/blocksadmin.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Method listBlocks has 213 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function listBlocks()
    {
        global $xoopsModule, $pathIcon16;
        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
        $moduleDirName      = \basename(\dirname(__DIR__));
Severity: Major
Found in admin/blocksadmin.php - About 1 day to fix

    File blocksadmin.php has 476 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * You may not change or alter any portion of this comment or credits
     * of supporting developers from this source code or any supporting source code
     * which is considered copyrighted (c) material of the original comment or credit authors.
    Severity: Minor
    Found in admin/blocksadmin.php - About 7 hrs to fix

      Function listBlocks has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

          function listBlocks()
          {
              global $xoopsModule, $pathIcon16;
              require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
              $moduleDirName      = \basename(\dirname(__DIR__));
      Severity: Minor
      Found in admin/blocksadmin.php - About 6 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

      Function isBlockCloned has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
          {
              xoops_loadLanguage('admin', 'system');
              xoops_loadLanguage('admin/blocksadmin', 'system');
              xoops_loadLanguage('admin/groups', 'system');
      Severity: Minor
      Found in admin/blocksadmin.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 isBlockCloned has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
          {
              xoops_loadLanguage('admin', 'system');
              xoops_loadLanguage('admin/blocksadmin', 'system');
              xoops_loadLanguage('admin/groups', 'system');
      Severity: Major
      Found in admin/blocksadmin.php - About 2 hrs to fix

        Function updateBlock has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
            {
                $myblock = new \XoopsBlock($bid);
                $myblock->setVar('title', $btitle);
                $myblock->setVar('weight', $bweight);
        Severity: Minor
        Found in admin/blocksadmin.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 cloneBlock has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function cloneBlock($bid)
            {
                xoops_cp_header();
                $moduleDirName      = \basename(\dirname(__DIR__));
                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
        Severity: Minor
        Found in admin/blocksadmin.php - About 1 hr to fix

          Method editBlock has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function editBlock($bid)
              {
                  //require __DIR__ . '/admin_header.php';
                  xoops_cp_header();
                  $moduleDirName = \basename(\dirname(__DIR__));
          Severity: Minor
          Found in admin/blocksadmin.php - About 1 hr to fix

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

                function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
                {
                    $myblock = new \XoopsBlock($bid);
                    $myblock->setVar('title', $btitle);
                    $myblock->setVar('weight', $bweight);
            Severity: Minor
            Found in admin/blocksadmin.php - About 1 hr to fix

              Method updateBlock has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
              Severity: Major
              Found in admin/blocksadmin.php - About 1 hr to fix

                Method isBlockCloned has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
                Severity: Major
                Found in admin/blocksadmin.php - About 50 mins to fix

                  Method setOrder has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      function setOrder($bid, $title, $weight, $visible, $side, $bcachetime)
                  Severity: Minor
                  Found in admin/blocksadmin.php - About 45 mins to fix

                    The function isBlockCloned() has an NPath complexity of 432. The configured NPath complexity threshold is 200.
                    Open

                        function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
                        {
                            xoops_loadLanguage('admin', 'system');
                            xoops_loadLanguage('admin/blocksadmin', 'system');
                            xoops_loadLanguage('admin/groups', 'system');
                    Severity: Minor
                    Found in admin/blocksadmin.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 function listBlocks() has an NPath complexity of 11665. The configured NPath complexity threshold is 200.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 function listBlocks() has 230 lines of code. Current threshold is set to 100. Avoid really long methods.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    The function listBlocks() has a Cyclomatic Complexity of 22. The configured cyclomatic complexity threshold is 10.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    CyclomaticComplexity

                    Since: 0.1

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

                    Example

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

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

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

                        function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
                        {
                            xoops_loadLanguage('admin', 'system');
                            xoops_loadLanguage('admin/blocksadmin', 'system');
                            xoops_loadLanguage('admin/groups', 'system');
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    CyclomaticComplexity

                    Since: 0.1

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

                    Example

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

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

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

                            $form->display();
                    Severity: Minor
                    Found in admin/blocksadmin.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 '$moduleDirNameUpper' which will lead to PHP notices.
                    Open

                            redirect_header($_SERVER['SCRIPT_NAME'], 1, constant('CO_' . $moduleDirNameUpper . '_' . 'UPDATE_SUCCESS'));
                    Severity: Minor
                    Found in admin/blocksadmin.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 '$form' which will lead to PHP notices.
                    Open

                            $form->display();
                    Severity: Minor
                    Found in admin/blocksadmin.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

                    Missing class import via use statement (line '346', column '22').
                    Open

                            $block = new \XoopsBlock($bid);
                    Severity: Minor
                    Found in admin/blocksadmin.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 '412', column '24').
                    Open

                            $myblock = new \XoopsBlock($bid);
                    Severity: Minor
                    Found in admin/blocksadmin.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 '71', column '28').
                    Open

                            $criteria->add(new \Criteria('isactive', 1));
                    Severity: Minor
                    Found in admin/blocksadmin.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 '295', column '24').
                    Open

                            $myblock = new \XoopsBlock($bid);
                    Severity: Minor
                    Found in admin/blocksadmin.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 '70', column '33').
                    Open

                            $criteria         = new \CriteriaCompo(new \Criteria('hasmain', 1));
                    Severity: Minor
                    Found in admin/blocksadmin.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 '70', column '52').
                    Open

                            $criteria         = new \CriteriaCompo(new \Criteria('hasmain', 1));
                    Severity: Minor
                    Found in admin/blocksadmin.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 '436', column '24').
                    Open

                            $myblock = new \XoopsBlock($bid);
                    Severity: Minor
                    Found in admin/blocksadmin.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 '484', column '24').
                    Open

                            $myblock = new \XoopsBlock($bid);
                    Severity: Minor
                    Found in admin/blocksadmin.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 listBlocks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                    Open

                                } else {
                                    $title = $i->getVar('title');
                                }
                    Severity: Minor
                    Found in admin/blocksadmin.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 '\XoopsDatabaseFactory' in method 'editBlock'.
                    Open

                            $db      = \XoopsDatabaseFactory::getDatabaseConnection();
                    Severity: Minor
                    Found in admin/blocksadmin.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 '\XoopsBlock' in method 'listBlocks'.
                    Open

                            $block_arr   = \XoopsBlock::getByModule($xoopsModule->mid());
                    Severity: Minor
                    Found in admin/blocksadmin.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 listBlocks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                    Open

                                    } else {
                                        $cachetime_options .= "<option value='$cachetime'>$cachetime_name</option>\n";
                                    }
                    Severity: Minor
                    Found in admin/blocksadmin.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 isBlockCloned uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                    Open

                            } else {
                                $clone->setVar('block_type', 'D');
                            }
                    Severity: Minor
                    Found in admin/blocksadmin.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 '\XoopsDatabaseFactory' in method 'cloneBlock'.
                    Open

                            $db      = \XoopsDatabaseFactory::getDatabaseConnection();
                    Severity: Minor
                    Found in admin/blocksadmin.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 'isBlockCloned'.
                    Open

                            $clone->setVar('title', Request::getString('btitle', '', 'POST'));
                    Severity: Minor
                    Found in admin/blocksadmin.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 '\XoopsDatabaseFactory' in method 'listBlocks'.
                    Open

                            $db                 = \XoopsDatabaseFactory::getDatabaseConnection();
                    Severity: Minor
                    Found in admin/blocksadmin.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 '\XoopsDatabaseFactory' in method 'isBlockCloned'.
                    Open

                            $db = \XoopsDatabaseFactory::getDatabaseConnection();
                    Severity: Minor
                    Found in admin/blocksadmin.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 listBlocks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                    Open

                                } else {
                                    $sel0 = ' checked';
                                }
                    Severity: Minor
                    Found in admin/blocksadmin.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 updateBlock uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                    Open

                                } else {
                                    foreach ($bmodule as $bmid) {
                                        $sql = sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid, (int)$bmid);
                                        $GLOBALS['xoopsDB']->query($sql);
                                    }
                    Severity: Minor
                    Found in admin/blocksadmin.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 function isBlockCloned() contains an exit expression.
                    Open

                                exit();
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    ExitExpression

                    Since: 0.2

                    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                    Example

                    class Foo {
                        public function bar($param)  {
                            if ($param === 42) {
                                exit(23);
                            }
                        }
                    }

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

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

                            $form->display();
                    Severity: Minor
                    Found in admin/blocksadmin.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

                    The function isBlockCloned() contains an exit expression.
                    Open

                                exit();
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    ExitExpression

                    Since: 0.2

                    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                    Example

                    class Foo {
                        public function bar($param)  {
                            if ($param === 42) {
                                exit(23);
                            }
                        }
                    }

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

                    Avoid unused parameters such as '$options'.
                    Open

                        function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
                    Severity: Minor
                    Found in admin/blocksadmin.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

                    The function cloneBlock() contains an exit expression.
                    Open

                            exit();
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    ExitExpression

                    Since: 0.2

                    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                    Example

                    class Foo {
                        public function bar($param)  {
                            if ($param === 42) {
                                exit(23);
                            }
                        }
                    }

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

                    The function editBlock() contains an exit expression.
                    Open

                            exit();
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    ExitExpression

                    Since: 0.2

                    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                    Example

                    class Foo {
                        public function bar($param)  {
                            if ($param === 42) {
                                exit(23);
                            }
                        }
                    }

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

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

                            $form->display();
                    Severity: Minor
                    Found in admin/blocksadmin.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 '$block'.
                    Open

                            $block     = [
                    Severity: Minor
                    Found in admin/blocksadmin.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 '$moduleDirNameUpper'.
                    Open

                            redirect_header($_SERVER['SCRIPT_NAME'], 1, constant('CO_' . $moduleDirNameUpper . '_' . 'UPDATE_SUCCESS'));
                    Severity: Minor
                    Found in admin/blocksadmin.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 '$block'.
                    Open

                            $block     = [
                    Severity: Minor
                    Found in admin/blocksadmin.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 '$block_count'.
                    Open

                            $block_count = count($block_arr);
                    Severity: Minor
                    Found in admin/blocksadmin.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 '$name'.
                    Open

                                $name = $i->getVar('name');
                    Severity: Minor
                    Found in admin/blocksadmin.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

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

                            $cachetimes  = [
                                0 => _NOCACHE,
                                30 => sprintf(_SECONDS, 30),
                                60 => _MINUTE,
                                300 => sprintf(_MINUTES, 5),
                    Severity: Major
                    Found in admin/blocksadmin.php and 1 other location - About 2 hrs to fix
                    admin/blockform.php on lines 86..98

                    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 140.

                    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 $db. Configured minimum length is 3.
                    Open

                            $db      = \XoopsDatabaseFactory::getDatabaseConnection();
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    ShortVariable

                    Since: 0.2

                    Detects when a field, local, or parameter has a very short name.

                    Example

                    class Something {
                        private $q = 15; // VIOLATION - Field
                        public static function main( array $as ) { // VIOLATION - Formal
                            $r = 20 + $this->q; // VIOLATION - Local
                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                $r += $this->q;
                            }
                        }
                    }

                    Source https://phpmd.org/rules/naming.html#shortvariable

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

                            $db = \XoopsDatabaseFactory::getDatabaseConnection();
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    ShortVariable

                    Since: 0.2

                    Detects when a field, local, or parameter has a very short name.

                    Example

                    class Something {
                        private $q = 15; // VIOLATION - Field
                        public static function main( array $as ) { // VIOLATION - Formal
                            $r = 20 + $this->q; // VIOLATION - Local
                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                $r += $this->q;
                            }
                        }
                    }

                    Source https://phpmd.org/rules/naming.html#shortvariable

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

                            $db                 = \XoopsDatabaseFactory::getDatabaseConnection();
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpmd

                    ShortVariable

                    Since: 0.2

                    Detects when a field, local, or parameter has a very short name.

                    Example

                    class Something {
                        private $q = 15; // VIOLATION - Field
                        public static function main( array $as ) { // VIOLATION - Formal
                            $r = 20 + $this->q; // VIOLATION - Local
                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                $r += $this->q;
                            }
                        }
                    }

                    Source https://phpmd.org/rules/naming.html#shortvariable

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

                            $db      = \XoopsDatabaseFactory::getDatabaseConnection();
                    Severity: Minor
                    Found in admin/blocksadmin.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

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

                    <?php
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 198 characters
                    Open

                                    echo "<option value='" . $grp->getVar('groupid') . "' " . (in_array($grp->getVar('groupid'), $groups_perms) ? " selected='selected'" : '') . '>' . $grp->getVar('name') . '</option>';
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 161 characters
                    Open

                                        $sql = sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid, (int)$bmid);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 130 characters
                    Open

                                $sql = sprintf('DELETE FROM `%s` WHERE gperm_itemid = %u', $GLOBALS['xoopsDB']->prefix('group_permission'), $bid[$i]);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 124 characters
                    Open

                                if ($_GET['op'] === "edit" || $_GET['op'] === "delete" || $_GET['op'] === "delete_ok" || $_GET['op'] === "clone"
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 200 characters
                    Open

                                    $sql = sprintf("INSERT INTO `%s` (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (%u, %u, 1, 'block_read')", $GLOBALS['xoopsDB']->prefix('group_permission'), $grp, $bid);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 158 characters
                    Open

                                echo '<td class="' . $class . '" align="center"> <select name="bcachetime[' . $i->getVar('bid') . ']" size="1">' . $cachetime_options . '</select>
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 148 characters
                    Open

                                    $sql = sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid, 0);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 156 characters
                    Open

                                        $sql = sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid[$i], 0);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 205 characters
                    Open

                                echo "<td class='$class' align='center'><a href='blocksadmin.php?op=edit&amp;bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/edit.png' . " alt='" . _EDIT . "' title='" . _EDIT . "'>
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 217 characters
                    Open

                            echo '<a href="blocksadmin.php">' . constant('CO_' . $moduleDirNameUpper . '_' . 'BADMIN') . '</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . _AM_SYSTEM_BLOCKS_CLONEBLOCK . '<br><br>';
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 177 characters
                    Open

                                echo "<td class='$class' align='center'><select size='5' name='bmodule[" . $i->getVar('bid') . "][]' id='bmodule[" . $i->getVar('bid') . "][]' multiple='multiple'>";
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 122 characters
                    Open

                            $sql = sprintf('DELETE FROM `%s` WHERE gperm_itemid = %u', $GLOBALS['xoopsDB']->prefix('group_permission'), $bid);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 131 characters
                    Open

                                    $sql = sprintf('DELETE FROM `%s` WHERE block_id = %u', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid[$i]);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 175 characters
                    Open

                                echo "<td class='$class' align='center'><select size='5' name='groups[" . $i->getVar('bid') . "][]' id='groups[" . $i->getVar('bid') . "][]' multiple='multiple'>";
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 208 characters
                    Open

                                        $sql = sprintf("INSERT INTO `%s` (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (%u, %u, 1, 'block_read')", $GLOBALS['xoopsDB']->prefix('group_permission'), $grp, $bid[$i]);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 126 characters
                    Open

                                     . "' size='5' maxlength='5'></td><td class='$class' align='center' nowrap><input type='radio' name='visible["
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 122 characters
                    Open

                                <input type='hidden' name='oldbcachetime[" . $i->getVar('bid') . "]' value='" . $i->getVar('bcachetime') . "'>
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 135 characters
                    Open

                                $sql = 'INSERT INTO ' . $db->prefix('block_module_link') . ' (block_id, module_id) VALUES (' . $newid . ', ' . $bmid . ')';
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 123 characters
                    Open

                                $sql = sprintf('DELETE FROM `%s` WHERE block_id = %u', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 236 characters
                    Open

                                    echo "&nbsp;<a href='" . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&amp;op=delete&amp;bid=' . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/delete.png' . " alt='" . _DELETE . "' title='" . _DELETE . "'>
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 216 characters
                    Open

                            echo '<a href="blocksadmin.php">' . constant('CO_' . $moduleDirNameUpper . '_' . 'BADMIN') . '</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . _AM_SYSTEM_BLOCKS_EDITBLOCK . '<br><br>';
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 182 characters
                    Open

                                     </a> <a href='blocksadmin.php?op=clone&amp;bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/editcopy.png' . " alt='" . _CLONE . "' title='" . _CLONE . "'>
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 190 characters
                    Open

                                $sql = 'INSERT INTO ' . $db->prefix('group_permission') . ' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (' . $groups[$i] . ', ' . $newid . ", 1, 'block_read')";
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 129 characters
                    Open

                                $sql          = 'SELECT module_id FROM ' . $db->prefix('block_module_link') . ' WHERE block_id=' . $i->getVar('bid');
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    Line exceeds 120 characters; contains 169 characters
                    Open

                                            $sql = sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid[$i], (int)$bmid);
                    Severity: Minor
                    Found in admin/blocksadmin.php by phpcodesniffer

                    The variable $module_list is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $is_custom is not named in camelCase.
                    Open

                        function cloneBlock($bid)
                        {
                            xoops_cp_header();
                            $moduleDirName      = \basename(\dirname(__DIR__));
                            $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                    Severity: Minor
                    Found in admin/blocksadmin.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 $block_arr is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $cachetime_options is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $cachetime_name is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $cachetime_options is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $is_custom is not named in camelCase.
                    Open

                        function editBlock($bid)
                        {
                            //require __DIR__ . '/admin_header.php';
                            xoops_cp_header();
                            $moduleDirName = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $block_count is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $cachetime_name is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $module_list is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $module_list is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $cachetime_options is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $block_arr is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $module_list is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $is_custom is not named in camelCase.
                    Open

                        function editBlock($bid)
                        {
                            //require __DIR__ . '/admin_header.php';
                            xoops_cp_header();
                            $moduleDirName = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $cachetime_options is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $is_custom is not named in camelCase.
                    Open

                        function cloneBlock($bid)
                        {
                            xoops_cp_header();
                            $moduleDirName      = \basename(\dirname(__DIR__));
                            $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                    Severity: Minor
                    Found in admin/blocksadmin.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 $groups_perms is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $module_list is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $cachetime_name is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $groups_perms is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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 $block_arr is not named in camelCase.
                    Open

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            $moduleDirName      = \basename(\dirname(__DIR__));
                    Severity: Minor
                    Found in admin/blocksadmin.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