mambax7/publisher

View on GitHub
class/VoteHandler.php

Summary

Maintainability
F
1 wk
Test Coverage

getItemRating accesses the super-global variable $GLOBALS.
Open

    public function getItemRating($itemId = null, $source = null): array
    {
        $itemId    = $itemId ?? 0;
        $source    = $source ?? 0;
        $xoopsUser = $GLOBALS['xoopsUser'];
Severity: Minor
Found in class/VoteHandler.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

getItemRating5 accesses the super-global variable $GLOBALS.
Open

    public function getItemRating5($itemObj = null, $source = null): array
    {
        $itemId    = $itemObj->itemid();
        $source    = $source ?? 0;
        $xoopsUser = $GLOBALS['xoopsUser'];
Severity: Minor
Found in class/VoteHandler.php by phpmd

Superglobals

Since: 0.2

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

Example

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

Source

Function getItemRating has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    public function getItemRating($itemId = null, $source = null): array
    {
        $itemId    = $itemId ?? 0;
        $source    = $source ?? 0;
        $xoopsUser = $GLOBALS['xoopsUser'];
Severity: Minor
Found in class/VoteHandler.php - About 7 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 getItemRating5 has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getItemRating5($itemObj = null, $source = null): array
    {
        $itemId    = $itemObj->itemid();
        $source    = $source ?? 0;
        $xoopsUser = $GLOBALS['xoopsUser'];
Severity: Major
Found in class/VoteHandler.php - About 5 hrs to fix

    Method getItemRating has 133 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getItemRating($itemId = null, $source = null): array
        {
            $itemId    = $itemId ?? 0;
            $source    = $source ?? 0;
            $xoopsUser = $GLOBALS['xoopsUser'];
    Severity: Major
    Found in class/VoteHandler.php - About 5 hrs to fix

      Function getItemRating5 has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getItemRating5($itemObj = null, $source = null): array
          {
              $itemId    = $itemObj->itemid();
              $source    = $source ?? 0;
              $xoopsUser = $GLOBALS['xoopsUser'];
      Severity: Minor
      Found in class/VoteHandler.php - About 4 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

      File VoteHandler.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace XoopsModules\Publisher;
      
      /*
      Severity: Minor
      Found in class/VoteHandler.php - About 3 hrs to fix

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

        class VoteHandler extends \XoopsPersistableObjectHandler
        {
            private const TABLE = 'publisher_rating';
            private const ENTITY = Vote::class;
            private const ENTITYNAME = 'Vote';
        Severity: Minor
        Found in class/VoteHandler.php by phpmd

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

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.php by phpmd

        The method getItemRating() has an NPath complexity of 242. The configured NPath complexity threshold is 200.
        Open

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.php by phpmd

        NPathComplexity

        Since: 0.1

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

        Example

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

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

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

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.php by phpmd

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

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.php by phpmd

        CyclomaticComplexity

        Since: 0.1

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

        Example

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

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

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

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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

        Missing class import via use statement (line '98', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '184', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '367', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 3));
        Severity: Minor
        Found in class/VoteHandler.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 '390', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '100', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '183', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '265', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '204', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '327', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 0, '>'));
        Severity: Minor
        Found in class/VoteHandler.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 '356', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '186', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 0, '<'));
        Severity: Minor
        Found in class/VoteHandler.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 '202', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '350', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '358', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '388', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '421', column '28').
        Open

                $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '307', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '357', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '366', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '375', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 4));
        Severity: Minor
        Found in class/VoteHandler.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 '325', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '372', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '374', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '142', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '159', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '373', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '263', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '264', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '381', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '161', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '308', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 0, '<'));
        Severity: Minor
        Found in class/VoteHandler.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 '324', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '380', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '140', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '305', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '348', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '389', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '420', column '28').
        Open

                $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '99', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '143', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 0, '<'));
        Severity: Minor
        Found in class/VoteHandler.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 '162', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 0, '>'));
        Severity: Minor
        Found in class/VoteHandler.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 '326', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '419', column '25').
        Open

                $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '306', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '364', column '29').
        Open

                    $criteria = new \CriteriaCompo();
        Severity: Minor
        Found in class/VoteHandler.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 '383', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 5));
        Severity: Minor
        Found in class/VoteHandler.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 '205', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 0, '>'));
        Severity: Minor
        Found in class/VoteHandler.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 '391', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 6));
        Severity: Minor
        Found in class/VoteHandler.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 '141', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '160', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '185', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 '203', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '349', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '359', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 2));
        Severity: Minor
        Found in class/VoteHandler.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 '365', column '32').
        Open

                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
        Severity: Minor
        Found in class/VoteHandler.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 '351', column '32').
        Open

                    $criteria->add(new \Criteria('rate', 1));
        Severity: Minor
        Found in class/VoteHandler.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 '382', column '32').
        Open

                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Minor
        Found in class/VoteHandler.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 getItemRating5 uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $itemRating['uid']     = $uid;
                    $itemRating['nb_vote'] = $count;
                    $itemRating['voted']   = $voted;
                    $itemRating['ip']      = $ip;
        Severity: Minor
        Found in class/VoteHandler.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 getItemRating uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                    } else {
                        $text      = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_X);
                        $shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_X);
                    }
        Severity: Minor
        Found in class/VoteHandler.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 getItemRating5 uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                    } else {
                        $text      = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_X);
                        $shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_X);
                    }
        Severity: Minor
        Found in class/VoteHandler.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 'XoopsModules\Publisher\Helper' in method '__construct'.
        Open

                $this->helper = $helper ?? Helper::getInstance();
        Severity: Minor
        Found in class/VoteHandler.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 getItemRating uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $itemRating['uid']     = $uid;
                    $itemRating['nb_vote'] = $count;
                    $itemRating['voted']   = $voted;
                    $itemRating['ip']      = $ip;
        Severity: Minor
        Found in class/VoteHandler.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

        TODO found
        Open

        //TODO
        Severity: Minor
        Found in class/VoteHandler.php by fixme

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

                } elseif (Constants::RATING_LIKES === $ratingbarsValue) {
                    // get count of "dislikes"
                    $criteria = new \CriteriaCompo();
                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Major
        Found in class/VoteHandler.php and 1 other location - About 2 days to fix
        class/VoteHandler.php on lines 138..182

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

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

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

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

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

        Refactorings

        Further Reading

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

                } elseif (Constants::RATING_LIKES === (int)$this->helper->getConfig('ratingbars')) {
                    // get count of "dislikes"
                    $criteria = new \CriteriaCompo();
                    $criteria->add(new \Criteria(static::IDENTIFIER, $itemId));
                    $criteria->add(new \Criteria(static::SOURCE, $source));
        Severity: Major
        Found in class/VoteHandler.php and 1 other location - About 2 days to fix
        class/VoteHandler.php on lines 303..347

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

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

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

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

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

        Refactorings

        Further Reading

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

                    if (1 == $count) {
                        $text      = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_1);
                        $shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_1);
                    } else {
                        $text      = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_X);
        Severity: Major
        Found in class/VoteHandler.php and 2 other locations - About 1 hr to fix
        class/RatingsHandler.php on lines 130..136
        class/VoteHandler.php on lines 284..290

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 120.

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

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

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

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

        Refactorings

        Further Reading

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

                    if (1 == $count) {
                        $text      = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_1);
                        $shorttext = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_SHORT_1);
                    } else {
                        $text      = \str_replace('%c', $itemRating['avg_rate_value'], \_MA_PUBLISHER_RATING_CURRENT_X);
        Severity: Major
        Found in class/VoteHandler.php and 2 other locations - About 1 hr to fix
        class/RatingsHandler.php on lines 130..136
        class/VoteHandler.php on lines 119..125

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 120.

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

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

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

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

        Refactorings

        Further Reading

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

            public function __construct(\XoopsDatabase $db = null, Helper $helper = null)
        Severity: Minor
        Found in class/VoteHandler.php by phpmd

        ShortVariable

        Since: 0.2

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

        Example

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

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

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

                $ip                    = \getenv('REMOTE_ADDR');
        Severity: Minor
        Found in class/VoteHandler.php by phpmd

        ShortVariable

        Since: 0.2

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

        Example

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

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

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

                $ip                    = \getenv('REMOTE_ADDR');
        Severity: Minor
        Found in class/VoteHandler.php by phpmd

        ShortVariable

        Since: 0.2

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

        Example

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

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

        The closing brace for the class must go on the next line after the body
        Open

        }
        Severity: Minor
        Found in class/VoteHandler.php by phpcodesniffer

        The variable $max_units is not named in camelCase.
        Open

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $rating_unitwidth is not named in camelCase.
        Open

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $rating_unitwidth is not named in camelCase.
        Open

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $max_units is not named in camelCase.
        Open

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $max_units is not named in camelCase.
        Open

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $max_units is not named in camelCase.
        Open

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $rating_unitwidth is not named in camelCase.
        Open

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $max_units is not named in camelCase.
        Open

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $max_units is not named in camelCase.
        Open

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $max_units is not named in camelCase.
        Open

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $rating_unitwidth is not named in camelCase.
        Open

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $rating_unitwidth is not named in camelCase.
        Open

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $rating_unitwidth is not named in camelCase.
        Open

            public function getItemRating5($itemObj = null, $source = null): array
            {
                $itemId    = $itemObj->itemid();
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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 $max_units is not named in camelCase.
        Open

            public function getItemRating($itemId = null, $source = null): array
            {
                $itemId    = $itemId ?? 0;
                $source    = $source ?? 0;
                $xoopsUser = $GLOBALS['xoopsUser'];
        Severity: Minor
        Found in class/VoteHandler.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