mambax7/publisher

View on GitHub
blocks/items_spot.php

Summary

Maintainability
D
2 days
Test Coverage

publisher_items_spot_show accesses the super-global variable $GLOBALS.
Open

function publisher_items_spot_show($options)
{
    //    global $xoTheme;
    $helper = Helper::getInstance();
    /** @var CategoryHandler $categoryHandler */
Severity: Minor
Found in blocks/items_spot.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 publisher_items_spot_show has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

function publisher_items_spot_show($options)
{
    //    global $xoTheme;
    $helper = Helper::getInstance();
    /** @var CategoryHandler $categoryHandler */
Severity: Minor
Found in blocks/items_spot.php - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method publisher_items_spot_show has 137 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function publisher_items_spot_show($options)
{
    //    global $xoTheme;
    $helper = Helper::getInstance();
    /** @var CategoryHandler $categoryHandler */
Severity: Major
Found in blocks/items_spot.php - About 5 hrs to fix

    Method publisher_items_spot_edit has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function publisher_items_spot_edit($options)
    {
        // require_once PUBLISHER_ROOT_PATH . '/class/blockform.php';
        xoops_load('XoopsFormLoader');
        $form     = new BlockForm();
    Severity: Major
    Found in blocks/items_spot.php - About 2 hrs to fix

      The function publisher_items_spot_show() has 151 lines of code. Current threshold is set to 100. Avoid really long methods.
      Open

      function publisher_items_spot_show($options)
      {
          //    global $xoTheme;
          $helper = Helper::getInstance();
          /** @var CategoryHandler $categoryHandler */
      Severity: Minor
      Found in blocks/items_spot.php by phpmd

      The function publisher_items_spot_show() has an NPath complexity of 2904. The configured NPath complexity threshold is 200.
      Open

      function publisher_items_spot_show($options)
      {
          //    global $xoTheme;
          $helper = Helper::getInstance();
          /** @var CategoryHandler $categoryHandler */
      Severity: Minor
      Found in blocks/items_spot.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 publisher_items_spot_show() has a Cyclomatic Complexity of 26. The configured cyclomatic complexity threshold is 10.
      Open

      function publisher_items_spot_show($options)
      {
          //    global $xoTheme;
          $helper = Helper::getInstance();
          /** @var CategoryHandler $categoryHandler */
      Severity: Minor
      Found in blocks/items_spot.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 '$category' which will lead to PHP notices.
      Open

                      $block['category'] = $category;
      Severity: Minor
      Found in blocks/items_spot.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 '$category' which will lead to PHP notices.
      Open

                          $category['image_path'] = Utility::getImageDir('category', false) . $cat->getImage();
      Severity: Minor
      Found in blocks/items_spot.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 '$category' which will lead to PHP notices.
      Open

                          $category['image_path'] = '';
      Severity: Minor
      Found in blocks/items_spot.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 '$category' which will lead to PHP notices.
      Open

                      $category['categoryurl'] = $cat->getCategoryUrl();
      Severity: Minor
      Found in blocks/items_spot.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 '$category' which will lead to PHP notices.
      Open

                      $category['name']        = $cat->name;
      Severity: Minor
      Found in blocks/items_spot.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 '199', column '21').
      Open

          $catEle   = new \XoopsFormLabel(_MB_PUBLISHER_SELECTCAT, Utility::createCategorySelect($options[2], 0, true, 'options[2]', false));
      Severity: Minor
      Found in blocks/items_spot.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 '214', column '20').
      Open

          $itemEle = new \XoopsFormSelect(_MB_PUBLISHER_SELECT_ITEMS, 'options[3]', $selItems, 10, true);
      Severity: Minor
      Found in blocks/items_spot.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 '242', column '26').
      Open

          $dispDate      = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_POSTTIME, 'options[13]', $options[13]);
      Severity: Minor
      Found in blocks/items_spot.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 '198', column '21').
      Open

          $countEle = new \XoopsFormText(_MB_PUBLISHER_LAST_ITEMS_COUNT, 'options[1]', 2, 255, $options[1]);
      Severity: Minor
      Found in blocks/items_spot.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 '227', column '24').
      Open

          $sortEle     = new \XoopsFormSelect(_MI_PUBLISHER_ORDERBY, 'options[9]', $options[9]);
      Severity: Minor
      Found in blocks/items_spot.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 '244', column '26').
      Open

          $dispAdminlink = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_ADMINLINK, 'options[15]', $options[15]);
      Severity: Minor
      Found in blocks/items_spot.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 '217', column '20').
      Open

          $comEle  = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_COMMENTS, 'options[5]', $options[5]);
      Severity: Minor
      Found in blocks/items_spot.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 '243', column '26').
      Open

          $dispCategory  = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_TOPICLINK, 'options[14]', $options[14]);
      Severity: Minor
      Found in blocks/items_spot.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 '226', column '24').
      Open

          $imageEle    = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_CATIMAGE, 'options[8]', $options[8]);
      Severity: Minor
      Found in blocks/items_spot.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 '24').
      Open

          $criteria    = new \CriteriaCompo();
      Severity: Minor
      Found in blocks/items_spot.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 '240', column '26').
      Open

          $readsEle      = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_READ, 'options[11]', $options[11]);
      Severity: Minor
      Found in blocks/items_spot.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 '239', column '26').
      Open

          $dispMoreEle   = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_MORELINK, 'options[10]', $options[10]);
      Severity: Minor
      Found in blocks/items_spot.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 '197', column '21').
      Open

          $autoEle  = new \XoopsFormRadioYN(_MB_PUBLISHER_AUTO_LAST_ITEMS, 'options[0]', $options[0]);
      Severity: Minor
      Found in blocks/items_spot.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 '218', column '20').
      Open

          $typeEle = new \XoopsFormSelect(_MB_PUBLISHER_DISPLAY_TYPE, 'options[6]', $options[6]);
      Severity: Minor
      Found in blocks/items_spot.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 '241', column '26').
      Open

          $dispImage     = new \XoopsFormRadioYN(_MB_PUBLISHER_IMGDISPLAY, 'options[12]', $options[12]);
      Severity: Minor
      Found in blocks/items_spot.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 '245', column '26').
      Open

          $dispReadmore  = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_READ_FULLITEM, 'options[16]', $options[16]);
      Severity: Minor
      Found in blocks/items_spot.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 '225', column '24').
      Open

          $truncateEle = new \XoopsFormText(_MB_PUBLISHER_TRUNCATE, 'options[7]', 4, 255, $options[7]);
      Severity: Minor
      Found in blocks/items_spot.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 '216', column '20').
      Open

          $whoEle  = new \XoopsFormRadioYN(_MB_PUBLISHER_DISPLAY_POSTEDBY, 'options[4]', $options[4]);
      Severity: Minor
      Found in blocks/items_spot.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 publisher_items_spot_show uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                      } else {
                          $category['image_path'] = '';
                      }
      Severity: Minor
      Found in blocks/items_spot.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\Utility' in method 'publisher_items_spot_show'.
      Open

                          $category['image_path'] = Utility::getImageDir('category', false) . $cat->getImage();
      Severity: Minor
      Found in blocks/items_spot.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 '\XoopsModules\Publisher\Helper' in method 'publisher_items_spot_show'.
      Open

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

                  } else {
                      $block['category']['categoryurl'] = XOOPS_URL . '/modules/' . PUBLISHER_DIRNAME;
                  }
      Severity: Minor
      Found in blocks/items_spot.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\Utility' in method 'publisher_items_spot_edit'.
      Open

          $catEle   = new \XoopsFormLabel(_MB_PUBLISHER_SELECTCAT, Utility::createCategorySelect($options[2], 0, true, 'options[2]', false));
      Severity: Minor
      Found in blocks/items_spot.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 publisher_items_spot_show uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

          } else {
              $i = 1;
              if ($selItems && is_array($selItems)) {
                  $itemsCount = count($selItems);
                  foreach ($selItems as $itemId) {
      Severity: Minor
      Found in blocks/items_spot.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 publisher_items_spot_edit uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

          } else {
              $selItems = explode(',', $options[3]);
          }
      Severity: Minor
      Found in blocks/items_spot.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 publisher_items_spot_show uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                          } else {
                              $item['showline'] = false;
                          }
      Severity: Minor
      Found in blocks/items_spot.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\Utility' in method 'publisher_items_spot_show'.
      Open

                              $item['summary']   = Utility::truncateHtml($item['summary'], $optTruncate);
      Severity: Minor
      Found in blocks/items_spot.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 '\XoopsModules\Publisher\Helper' in method 'publisher_items_spot_edit'.
      Open

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

                      } else {
                          $item['showline'] = false;
                      }
      Severity: Minor
      Found in blocks/items_spot.php by phpmd

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

                  foreach ($itemsObj as $key => $thisItem) {
      Severity: Minor
      Found in blocks/items_spot.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 excessively long variable names like $optdisplaycategorylink. Keep variable name length under 20.
      Open

          $optdisplaycategorylink = $options[14] ?? '';
      Severity: Minor
      Found in blocks/items_spot.php by phpmd

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

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

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

              $i          = 1;
      Severity: Minor
      Found in blocks/items_spot.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 35 and the first side effect is on line 28.
      Open

      <?php declare(strict_types=1);
      Severity: Minor
      Found in blocks/items_spot.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status