mambax7/publisher

View on GitHub
class/Item.php

Summary

Maintainability
F
6 days
Test Coverage

getMainImage accesses the super-global variable $GLOBALS.
Open

    public function getMainImage($item = [])
    {
        $images             = $this->getImages();
        $item['image_path'] = '';
        $item['image_name'] = '';
Severity: Minor
Found in class/Item.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

convertForJapanese accesses the super-global variable $GLOBALS.
Open

    protected function convertForJapanese($str)
    {
        // no action, if not flag
        if (!\defined('_PUBLISHER_FLAG_JP_CONVERT')) {
            return $str;
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest()
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest()
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest()
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

getAdminLinks accesses the super-global variable $GLOBALS.
Open

    public function getAdminLinks($icons)
    {
        $adminLinks = '';
        if (\is_object($GLOBALS['xoopsUser'])
            && (Utility::userIsAdmin() || Utility::userIsAuthor($this)
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest()
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest()
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest()
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

getOtherImages accesses the super-global variable $GLOBALS.
Open

    public function getOtherImages($item = [])
    {
        $images         = $this->getImages();
        $item['images'] = [];
        $i              = 0;
Severity: Minor
Found in class/Item.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

setVarsFromRequest accesses the super-global variable $GLOBALS.
Open

    public function setVarsFromRequest()
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Minor
Found in class/Item.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

File Item.php has 753 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);

namespace XoopsModules\Publisher;
Severity: Major
Found in class/Item.php - About 1 day to fix

    Item has 49 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Item extends \XoopsObject
    {
        public const PAGEWRAP = '[pagewrap=';
        public const BODYTAG = '<body>';
        /**
    Severity: Minor
    Found in class/Item.php - About 6 hrs to fix

      Method setVarsFromRequest has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function setVarsFromRequest()
          {
              //Required fields
              //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
              //            $this->setVar('categoryid', $categoryid);}
      Severity: Major
      Found in class/Item.php - About 3 hrs to fix

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

        class Item extends \XoopsObject
        {
            public const PAGEWRAP = '[pagewrap=';
            public const BODYTAG = '<body>';
            /**
        Severity: Minor
        Found in class/Item.php by phpmd

        The class Item has 18 public methods. Consider refactoring Item to keep number of public methods under 10.
        Open

        class Item extends \XoopsObject
        {
            public const PAGEWRAP = '[pagewrap=';
            public const BODYTAG = '<body>';
            /**
        Severity: Minor
        Found in class/Item.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

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

        Function setVarsFromRequest has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            public function setVarsFromRequest()
            {
                //Required fields
                //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
                //            $this->setVar('categoryid', $categoryid);}
        Severity: Minor
        Found in class/Item.php - About 3 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 toArraySimple has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
            {
                $itemPageId = -1;
                if (\is_numeric($display)) {
                    $itemPageId = $display;
        Severity: Major
        Found in class/Item.php - About 2 hrs to fix

          Function getBody has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getBody($maxLength = 0, $format = 'S', $stripTags = '')
              {
                  $ret     = $this->getVar('body', $format);
                  $wrapPos = \mb_strpos($ret, self::PAGEWRAP);
                  if (!(false === $wrapPos)) {
          Severity: Minor
          Found in class/Item.php - About 2 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function toArraySimple has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
              {
                  $itemPageId = -1;
                  if (\is_numeric($display)) {
                      $itemPageId = $display;
          Severity: Minor
          Found in class/Item.php - About 2 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function getAdminLinks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getAdminLinks($icons)
              {
                  $adminLinks = '';
                  if (\is_object($GLOBALS['xoopsUser'])
                      && (Utility::userIsAdmin() || Utility::userIsAuthor($this)
          Severity: Minor
          Found in class/Item.php - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function getImages has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getImages()
              {
                  static $ret;
                  $itemId = $this->getVar('itemid');
                  if (!isset($ret[$itemId])) {
          Severity: Minor
          Found in class/Item.php - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Method __construct has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct($id = null)
              {
          //        $this->helper = Helper::getInstance();
                  $this->db     = \XoopsDatabaseFactory::getDatabaseConnection();
                  $this->initVar('itemid', \XOBJ_DTYPE_INT, 0);
          Severity: Minor
          Found in class/Item.php - About 1 hr to fix

            Method getBody has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getBody($maxLength = 0, $format = 'S', $stripTags = '')
                {
                    $ret     = $this->getVar('body', $format);
                    $wrapPos = \mb_strpos($ret, self::PAGEWRAP);
                    if (!(false === $wrapPos)) {
            Severity: Minor
            Found in class/Item.php - About 1 hr to fix

              Method getImages has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getImages()
                  {
                      static $ret;
                      $itemId = $this->getVar('itemid');
                      if (!isset($ret[$itemId])) {
              Severity: Minor
              Found in class/Item.php - About 1 hr to fix

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

                    public function sendNotifications($notifications = [])
                    {
                        /** @var \XoopsNotificationHandler $notificationHandler */
                        $notificationHandler = \xoops_getHandler('notification');
                        $tags                = [];
                Severity: Minor
                Found in class/Item.php - About 1 hr to fix

                  The class Item has 52 public methods and attributes. Consider reducing the number of public items to less than 45.
                  Open

                  class Item extends \XoopsObject
                  {
                      public const PAGEWRAP = '[pagewrap=';
                      public const BODYTAG = '<body>';
                      /**
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  ExcessivePublicCount

                  Since: 0.1

                  A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

                  Example

                  public class Foo {
                      public $value;
                      public $something;
                      public $var;
                      // [... more more public attributes ...]
                  
                      public function doWork() {}
                      public function doMoreWork() {}
                      public function doWorkAgain() {}
                      // [... more more public methods ...]
                  }

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

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

                      public function store($force = true)
                      {
                          $isNew = $this->isNew();
                          if (!$this->helper->getHandler('Item')->insert($this, $force)) {
                              return false;
                  Severity: Minor
                  Found in class/Item.php - About 55 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function convertForJapanese has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function convertForJapanese($str)
                      {
                          // no action, if not flag
                          if (!\defined('_PUBLISHER_FLAG_JP_CONVERT')) {
                              return $str;
                  Severity: Minor
                  Found in class/Item.php - About 45 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function getSummary has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getSummary($maxLength = 0, $format = 'S', $stripTags = '')
                      {
                          $ret = $this->getVar('summary', $format);
                          if (!empty($stripTags)) {
                              $ret = \strip_tags($ret, $stripTags);
                  Severity: Minor
                  Found in class/Item.php - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function getTitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getTitle($maxLength = 0, $format = 'S')
                      {
                          $ret = $this->getVar('title', $format);
                          if (0 != $maxLength) {
                              if (!XOOPS_USE_MULTIBYTES) {
                  Severity: Minor
                  Found in class/Item.php - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function getSubtitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getSubtitle($maxLength = 0, $format = 'S')
                      {
                          $ret = $this->getVar('subtitle', $format);
                          if (0 != $maxLength) {
                              if (!XOOPS_USE_MULTIBYTES) {
                  Severity: Minor
                  Found in class/Item.php - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function sendNotifications has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function sendNotifications($notifications = [])
                      {
                          /** @var \XoopsNotificationHandler $notificationHandler */
                          $notificationHandler = \xoops_getHandler('notification');
                          $tags                = [];
                  Severity: Minor
                  Found in class/Item.php - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  The class Item has 1147 lines of code. Current threshold is 1000. Avoid really long classes.
                  Open

                  class Item extends \XoopsObject
                  {
                      public const PAGEWRAP = '[pagewrap=';
                      public const BODYTAG = '<body>';
                      /**
                  Severity: Minor
                  Found in class/Item.php by phpmd

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

                      public function setVarsFromRequest()
                      {
                          //Required fields
                          //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
                          //            $this->setVar('categoryid', $categoryid);}
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  The method toArraySimple() has an NPath complexity of 210. The configured NPath complexity threshold is 200.
                  Open

                      public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
                      {
                          $itemPageId = -1;
                          if (\is_numeric($display)) {
                              $itemPageId = $display;
                  Severity: Minor
                  Found in class/Item.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 setVarsFromRequest() has an NPath complexity of 972. The configured NPath complexity threshold is 200.
                  Open

                      public function setVarsFromRequest()
                      {
                          //Required fields
                          //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
                          //            $this->setVar('categoryid', $categoryid);}
                  Severity: Minor
                  Found in class/Item.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 setVarsFromRequest() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function setVarsFromRequest()
                      {
                          //Required fields
                          //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
                          //            $this->setVar('categoryid', $categoryid);}
                  Severity: Minor
                  Found in class/Item.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 getAdminLinks() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function getAdminLinks($icons)
                      {
                          $adminLinks = '';
                          if (\is_object($GLOBALS['xoopsUser'])
                              && (Utility::userIsAdmin() || Utility::userIsAuthor($this)
                  Severity: Minor
                  Found in class/Item.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 getBody() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function getBody($maxLength = 0, $format = 'S', $stripTags = '')
                      {
                          $ret     = $this->getVar('body', $format);
                          $wrapPos = \mb_strpos($ret, self::PAGEWRAP);
                          if (!(false === $wrapPos)) {
                  Severity: Minor
                  Found in class/Item.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 toArraySimple() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
                      {
                          $itemPageId = -1;
                          if (\is_numeric($display)) {
                              $itemPageId = $display;
                  Severity: Minor
                  Found in class/Item.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 '$ret' which will lead to PHP notices.
                  Open

                          if (!isset($ret[$itemId])) {
                  Severity: Minor
                  Found in class/Item.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 '$ret' which will lead to PHP notices.
                  Open

                                      $ret[$itemId]['main'] = $imageObj;
                  Severity: Minor
                  Found in class/Item.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 '$ret' which will lead to PHP notices.
                  Open

                              $ret[$itemId]['main']   = '';
                  Severity: Minor
                  Found in class/Item.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 '$ret' which will lead to PHP notices.
                  Open

                          return $ret[$itemId];
                  Severity: Minor
                  Found in class/Item.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 '$ret' which will lead to PHP notices.
                  Open

                              $ret[$itemId]['others'] = [];
                  Severity: Minor
                  Found in class/Item.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 '$ret' which will lead to PHP notices.
                  Open

                                      $ret[$itemId]['others'][] = $imageObj;
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  UndefinedVariable

                  Since: 2.8.0

                  Detects when a variable is used that has not been defined before.

                  Example

                  class Foo
                  {
                      private function bar()
                      {
                          // $message is undefined
                          echo $message;
                      }
                  }

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

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

                  class Item extends \XoopsObject
                  {
                      public const PAGEWRAP = '[pagewrap=';
                      public const BODYTAG = '<body>';
                      /**
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  CouplingBetweenObjects

                  Since: 1.1.0

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

                  Example

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

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

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

                      public function store($force = true)
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

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

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

                      public function getCategoryPath($withAllLink = true)
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

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

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

                      public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

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

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

                      public function getItemLink($class = false, $maxsize = 0)
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

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

                  Missing class import via use statement (line '747', column '56').
                  Open

                                  $criteria     = new \CriteriaCompo(new \Criteria('image_id', '(' . \implode(',', $imagesIds) . ')', 'IN'));
                  Severity: Minor
                  Found in class/Item.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 getForm has a boolean flag argument $checkperm, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public function getForm($title = 'default', $checkperm = true)
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

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

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

                      public function getBlockSummary($maxLength = 0, $fullSummary = false)
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

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

                  Missing class import via use statement (line '747', column '37').
                  Open

                                  $criteria     = new \CriteriaCompo(new \Criteria('image_id', '(' . \implode(',', $imagesIds) . ')', 'IN'));
                  Severity: Minor
                  Found in class/Item.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

                  Avoid using static access to class '\XoopsUserUtility' in method 'posterName'.
                  Open

                              $ret = \XoopsUserUtility::getUnameFromId($this->uid(), $realName);
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                              if ($this->helper->getConfig('perm_clone') || Utility::userIsModerator($this) || Utility::userIsAdmin()) {
                  Severity: Minor
                  Found in class/Item.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 toArraySimple uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $item['comments'] = '&nbsp;' . \_MD_PUBLISHER_NO_COMMENTS . '&nbsp;';
                          }
                  Severity: Minor
                  Found in class/Item.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 '\Xmf\Request' in method 'setVarsFromRequest'.
                  Open

                              $this->setVar('dosmiley', Request::getInt('dosmiley', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              $this->setVar('doimage', Request::getInt('doimage', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                                  if ($this->helper->getConfig('perm_edit') || Utility::userIsModerator($this) || Utility::userIsAdmin()) {
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                              if ($this->helper->getConfig('perm_clone') || Utility::userIsModerator($this) || Utility::userIsAdmin()) {
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          if ($highlight && Request::getString('keywords', '', 'GET')) {
                  Severity: Minor
                  Found in class/Item.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 getPdfButton uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              //                if (is_object($GLOBALS['xoopsUser']) && Utility::userIsAdmin()) {
                              //                    $GLOBALS['xoTheme']->addStylesheet('/modules/system/css/jquery.jgrowl.min.css');
                              //                    $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.jgrowl.js');
                              //                    $adminLinks .= '<script type="text/javascript">
                  Severity: Minor
                  Found in class/Item.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 '\Xmf\Request' in method 'setVarsFromRequest'.
                  Open

                          $this->setVar('title', Request::getString('title', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.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 getImages uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                  } else {
                                      $ret[$itemId]['others'][] = $imageObj;
                                  }
                  Severity: Minor
                  Found in class/Item.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 '\Xmf\Request' in method 'setVarsFromRequest'.
                  Open

                              $resTime     = Request::getArray('datesub', [], 'POST');
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          $this->setVar('meta_keywords', Request::getString('item_meta_keywords', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.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 setVarsFromRequest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $this->setVar('dateexpire', 0);
                          }
                  Severity: Minor
                  Found in class/Item.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 '\Xmf\Request' in method 'setVarsFromRequest'.
                  Open

                              $this->setVar('dobr', Request::getInt('dolinebreak', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              $this->setVar('votetype', Request::getInt('votetype', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          $this->setVar('notifypub', Request::getString('notify', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              $keywords = \htmlspecialchars(\trim(\urldecode(Request::getString('keywords', '', 'GET'))), \ENT_QUOTES | \ENT_HTML5);
                  Severity: Minor
                  Found in class/Item.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 getOtherImages uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $item['images'][$i]['thumb'] = XOOPS_URL . '/uploads/' . $image->getVar('image_name');
                              }
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  ElseExpression

                  Since: 1.4.0

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

                  Example

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

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

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

                      public function setVarsFromRequest()
                      {
                          //Required fields
                          //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
                          //            $this->setVar('categoryid', $categoryid);}
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  IfStatementAssignment

                  Since: 2.7.0

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

                  Example

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

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

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

                          $this->setVar('subtitle', Request::getString('subtitle', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          if ('' !== ($imageFeatured = Request::getString('image_featured', '', 'POST'))) {
                  Severity: Minor
                  Found in class/Item.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 setVarsFromRequest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $this->setVar('image', 0);
                              $this->setVar('images', '');
                          }
                  Severity: Minor
                  Found in class/Item.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 'getAdminLinks'.
                  Open

                              if (Utility::userIsAdmin() || Utility::userIsAuthor($this) || Utility::userIsModerator($this)) {
                  Severity: Minor
                  Found in class/Item.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 '\XoopsUserUtility' in method 'getLinkedPosterName'.
                  Open

                              $ret = \XoopsUserUtility::getUnameFromId($this->uid(), $this->helper->getConfig('format_realname'), true);
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                              if (Utility::userIsAdmin() || Utility::userIsAuthor($this) || Utility::userIsModerator($this)) {
                  Severity: Minor
                  Found in class/Item.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 getMainImage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $item['image_thumb'] = XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name');
                              }
                  Severity: Minor
                  Found in class/Item.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 'accessGranted'.
                  Open

                          if (Utility::userIsAdmin()) {
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          $this->setVar('body', Request::getText('body', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.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 '\DateTime' in method 'setVarsFromRequest'.
                  Open

                              $dateTimeObj = \DateTime::createFromFormat(_SHORTDATESTRING, $resDate['date']);
                  Severity: Minor
                  Found in class/Item.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 '\DateTime' in method 'setVarsFromRequest'.
                  Open

                                  $dateTimeObj = \DateTime::createFromFormat(_SHORTDATESTRING, $resExDate['date']);
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          $this->setVar('short_url', Request::getString('item_short_url', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          $this->setVar('meta_description', Request::getString('item_meta_description', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.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 getBlockSummary uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $ret = $this->getSummary($maxLength, 's', '<br><br>');
                          }
                  Severity: Minor
                  Found in class/Item.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 'getBody'.
                  Open

                                      $ret = Utility::truncateHtml($ret, $maxLength, $etc = '...', $breakWords = false);
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                              if (Utility::userIsAdmin() || Utility::userIsAuthor($this) || Utility::userIsModerator($this)) {
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                                  if ($this->helper->getConfig('perm_delete') || Utility::userIsModerator($this) || Utility::userIsAdmin()) {
                  Severity: Minor
                  Found in class/Item.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\Seo' in method 'getPrintLinks'.
                  Open

                          $printLinks .= "<a href='" . Seo::generateUrl('print', $this->itemid(), $this->short_url()) . "' rel='nofollow' target='_blank'>" . $icons['print'] . '</a>&nbsp;';
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

                  Avoid using static access to class '\XoopsDatabaseFactory' in method '__construct'.
                  Open

                          $this->db     = \XoopsDatabaseFactory::getDatabaseConnection();
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getSubtitle'.
                  Open

                                      $ret = Utility::substr($ret, 0, $maxLength);
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getTitle'.
                  Open

                                      $ret = Utility::substr($ret, 0, $maxLength);
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getSummary'.
                  Open

                                      $ret = Utility::truncateHtml($ret, $maxLength, $etc = '...', $breakWords = false);
                  Severity: Minor
                  Found in class/Item.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\Seo' in method 'getItemUrl'.
                  Open

                          return Seo::generateUrl('item', $this->itemid(), $this->short_url());
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                                  if ($this->helper->getConfig('perm_delete') || Utility::userIsModerator($this) || Utility::userIsAdmin()) {
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          $this->setVar('categoryid', Request::getInt('categoryid', 0, 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                                  $resExTime   = Request::getArray('dateexpire', [], 'POST');
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          $agent   = Request::getString('HTTP_USER_AGENT', '', 'SERVER');
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              if ('' !== Request::getString('dateexpire', '', 'POST')) {
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'wrapPage'.
                  Open

                          $page    = Utility::getUploadDir(true, 'content') . $fileName;
                  Severity: Minor
                  Found in class/Item.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 '\MyTextSanitizer' in method 'wrapPage'.
                  Open

                              $myts = \MyTextSanitizer::getInstance();
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                              && (Utility::userIsAdmin() || Utility::userIsAuthor($this)
                  Severity: Minor
                  Found in class/Item.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 assigning values to variables in if clauses and the like (line '1080', column '21').
                  Open

                      public function setVarsFromRequest()
                      {
                          //Required fields
                          //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
                          //            $this->setVar('categoryid', $categoryid);}
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  IfStatementAssignment

                  Since: 2.7.0

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

                  Example

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

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

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

                              $resDate     = Request::getArray('datesub', [], 'POST');
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              $this->setVar('dohtml', Request::getInt('dohtml', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                                  if ($this->helper->getConfig('perm_edit') || Utility::userIsModerator($this) || Utility::userIsAdmin()) {
                  Severity: Minor
                  Found in class/Item.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 toArraySimple uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $item['comments'] = '&nbsp;' . $comments . '&nbsp;' . \_MD_PUBLISHER_COMMENTS . '&nbsp;';
                              }
                  Severity: Minor
                  Found in class/Item.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 '\Xmf\Request' in method 'setVarsFromRequest'.
                  Open

                          $this->setVar('item_tag', Request::getString('item_tag', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              $imageItem = Request::getArray('image_item', [], 'POST');
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getCategoryImagePath'.
                  Open

                          return Utility::getImageDir('category', false) . $this->getCategory()->getImage();
                  Severity: Minor
                  Found in class/Item.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\Utility' in method 'getAdminLinks'.
                  Open

                              && (Utility::userIsAdmin() || Utility::userIsAuthor($this)
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          if (0 !== Request::getInt('use_expire_yn', 0, 'POST')) {
                  Severity: Minor
                  Found in class/Item.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 setVarsFromRequest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $userTimeoffset = null;
                          }
                  Severity: Minor
                  Found in class/Item.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 '\Xmf\Request' in method 'setVarsFromRequest'.
                  Open

                          $this->setVar('summary', Request::getText('summary', '', 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          if (false !== ($authorAlias = Request::getString('author_alias', '', 'POST'))) {
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                                  $resExDate   = Request::getArray('dateexpire', [], 'POST');
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          if ('' !== Request::getString('datesub', '', 'POST')) {
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              $this->setVar('uid', Request::getInt('uid', 0, 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              $this->setVar('doxcode', Request::getInt('doxcode', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                          $this->setVar('weight', Request::getInt('weight', 0, 'POST'));
                  Severity: Minor
                  Found in class/Item.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 setVarsFromRequest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $this->setVar('uid', Request::getInt('uid', 0, 'POST'));
                              $this->setVar('cancomment', Request::getInt('allowcomments', 1, 'POST'));
                              $this->setVar('status', Request::getInt('status', 1, 'POST'));
                              $this->setVar('dohtml', Request::getInt('dohtml', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.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 '\Xmf\Request' in method 'setVarsFromRequest'.
                  Open

                              $this->setVar('cancomment', Request::getInt('allowcomments', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  StaticAccess

                  Since: 1.4.0

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

                  Example

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

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

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

                              $this->setVar('status', Request::getInt('status', 1, 'POST'));
                  Severity: Minor
                  Found in class/Item.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 unused local variables such as '$breakWords'.
                  Open

                                      $ret = Utility::truncateHtml($ret, $maxLength, $etc = '...', $breakWords = false);
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

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

                  Example

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

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

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

                                      $ret = Utility::truncateHtml($ret, $maxLength, $etc = '...', $breakWords = false);
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

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

                  Example

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

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

                  Avoid unused parameters such as '$fullSummary'.
                  Open

                      public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  UnusedFormalParameter

                  Since: 0.2

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

                  Example

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

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

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

                                      $ret = Utility::truncateHtml($ret, $maxLength, $etc = '...', $breakWords = false);
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

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

                  Example

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

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

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

                                      $ret = Utility::truncateHtml($ret, $maxLength, $etc = '...', $breakWords = false);
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

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

                  Example

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

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

                  TODO found
                  Open

                          //mb TODO check on version
                  Severity: Minor
                  Found in class/Item.php by fixme

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

                      public function getTitle($maxLength = 0, $format = 'S')
                      {
                          $ret = $this->getVar('title', $format);
                          if (0 != $maxLength) {
                              if (!XOOPS_USE_MULTIBYTES) {
                  Severity: Minor
                  Found in class/Item.php and 1 other location - About 30 mins to fix
                  class/Item.php on lines 152..164

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

                  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

                      public function getSubtitle($maxLength = 0, $format = 'S')
                      {
                          $ret = $this->getVar('subtitle', $format);
                          if (0 != $maxLength) {
                              if (!XOOPS_USE_MULTIBYTES) {
                  Severity: Minor
                  Found in class/Item.php and 1 other location - About 30 mins to fix
                  class/Item.php on lines 132..144

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 90.

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

                          $os      = '';
                  Severity: Minor
                  Found in class/Item.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 $i. Configured minimum length is 3.
                  Open

                          $i              = 0;
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  ShortVariable

                  Since: 0.2

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

                  Example

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

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

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

                      public $db;
                  Severity: Minor
                  Found in class/Item.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 $id. Configured minimum length is 3.
                  Open

                      public function __construct($id = null)
                  Severity: Minor
                  Found in class/Item.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 $id. Configured minimum length is 3.
                  Open

                                  $id        = $myrow['image_id'];
                  Severity: Minor
                  Found in class/Item.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 38 and the first side effect is on line 33.
                  Open

                  <?php
                  Severity: Minor
                  Found in class/Item.php by phpcodesniffer

                  There must be one blank line after the last USE statement; 0 found;
                  Open

                  use XoopsModules\Publisher\{
                  Severity: Minor
                  Found in class/Item.php by phpcodesniffer

                  There must be one USE keyword per declaration
                  Open

                  use XoopsModules\Publisher\{
                  Severity: Minor
                  Found in class/Item.php by phpcodesniffer

                  There must be a comment when fall-through is intentional in a non-empty case body
                  Open

                              case 'wfsection':
                  Severity: Minor
                  Found in class/Item.php by phpcodesniffer

                  There must be a comment when fall-through is intentional in a non-empty case body
                  Open

                              case 'full':
                  Severity: Minor
                  Found in class/Item.php by phpcodesniffer

                  There must be a comment when fall-through is intentional in a non-empty case body
                  Open

                              case 'summary':
                  Severity: Minor
                  Found in class/Item.php by phpcodesniffer

                  The variable $module_id is not named in camelCase.
                  Open

                      public function assignOtherProperties()
                      {
                          $module = $this->helper->getModule();
                          $module_id   = $module->getVar('mid');
                          /** @var \XoopsGroupPermHandler $grouppermHandler */
                  Severity: Minor
                  Found in class/Item.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

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

                  Example

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

                  Source

                  The variable $module_id is not named in camelCase.
                  Open

                      public function assignOtherProperties()
                      {
                          $module = $this->helper->getModule();
                          $module_id   = $module->getVar('mid');
                          /** @var \XoopsGroupPermHandler $grouppermHandler */
                  Severity: Minor
                  Found in class/Item.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