XoopsModules25x/xoopspoll

View on GitHub
class/Poll.php

Summary

Maintainability
D
2 days
Test Coverage

isAllowedToVote accesses the super-global variable $GLOBALS.
Open

    public function isAllowedToVote(): bool
    {
        $ret = false;
        if ((Constants::ANONYMOUS_VOTING_ALLOWED === $this->getVar('anonymous'))
            || (($GLOBALS['xoopsUser'] instanceof \XoopsUser)
Severity: Minor
Found in class/Poll.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

__construct accesses the super-global variable $GLOBALS.
Open

    public function __construct($id = null)
    {
        parent::__construct();
        //        $timestamp = xoops_getUserTimestamp(time());
        $currentTimestamp = \time();
Severity: Minor
Found in class/Poll.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

vote accesses the super-global variable $GLOBALS.
Open

    public function vote(int $optionId, string $ip, int $time): bool
    {
        if (!empty($optionId) && $this->isAllowedToVote()) {
            $voteTime      = empty($time) ? \time() : (int)$time;
            $uid           = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) ? $GLOBALS['xoopsUser']->uid() : 0;
Severity: Minor
Found in class/Poll.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

vote accesses the super-global variable $GLOBALS.
Open

    public function vote(int $optionId, string $ip, int $time): bool
    {
        if (!empty($optionId) && $this->isAllowedToVote()) {
            $voteTime      = empty($time) ? \time() : (int)$time;
            $uid           = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) ? $GLOBALS['xoopsUser']->uid() : 0;
Severity: Minor
Found in class/Poll.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

isAllowedToVote accesses the super-global variable $GLOBALS.
Open

    public function isAllowedToVote(): bool
    {
        $ret = false;
        if ((Constants::ANONYMOUS_VOTING_ALLOWED === $this->getVar('anonymous'))
            || (($GLOBALS['xoopsUser'] instanceof \XoopsUser)
Severity: Minor
Found in class/Poll.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

__construct accesses the super-global variable $GLOBALS.
Open

    public function __construct($id = null)
    {
        parent::__construct();
        //        $timestamp = xoops_getUserTimestamp(time());
        $currentTimestamp = \time();
Severity: Minor
Found in class/Poll.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

vote accesses the super-global variable $GLOBALS.
Open

    public function vote(int $optionId, string $ip, int $time): bool
    {
        if (!empty($optionId) && $this->isAllowedToVote()) {
            $voteTime      = empty($time) ? \time() : (int)$time;
            $uid           = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) ? $GLOBALS['xoopsUser']->uid() : 0;
Severity: Minor
Found in class/Poll.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

renderForm accesses the super-global variable $GLOBALS.
Open

    public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
    {
        \xoops_load('xoopsformloader');
        $myts = \MyTextSanitizer::getInstance();

Severity: Minor
Found in class/Poll.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

renderForm accesses the super-global variable $GLOBALS.
Open

    public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
    {
        \xoops_load('xoopsformloader');
        $myts = \MyTextSanitizer::getInstance();

Severity: Minor
Found in class/Poll.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

isAllowedToVote accesses the super-global variable $GLOBALS.
Open

    public function isAllowedToVote(): bool
    {
        $ret = false;
        if ((Constants::ANONYMOUS_VOTING_ALLOWED === $this->getVar('anonymous'))
            || (($GLOBALS['xoopsUser'] instanceof \XoopsUser)
Severity: Minor
Found in class/Poll.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

notifyVoter accesses the super-global variable $GLOBALS.
Open

    public function notifyVoter(\XoopsUser $user = null): bool
    {
        if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
            \xoops_loadLanguage('main', 'xoopspoll');
            $xoopsMailer = \xoops_getMailer();
Severity: Minor
Found in class/Poll.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

store accesses the super-global variable $GLOBALS.
Open

    public function store(): mixed
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated since Xoopspoll 1.40, please use PollHandler::insert() instead.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}");
        $pollHandler = $this->getStaticPollHandler();
Severity: Minor
Found in class/Poll.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

isResultVisible accesses the super-global variable $GLOBALS.
Open

    public function isResultVisible()
    {
        $visibleMsg = '';
        \xoops_loadLanguage('main', 'xoopspoll');
        switch ($this->getVar('visibility')) {
Severity: Minor
Found in class/Poll.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

updateCount accesses the super-global variable $GLOBALS.
Open

    public function updateCount()
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated since Xoopspoll 1.40, please use PollHandler::' . __METHOD__ . ' instead.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}");
        $pollHandler = $this->getStaticPollHandler();
Severity: Minor
Found in class/Poll.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

notifyVoter accesses the super-global variable $GLOBALS.
Open

    public function notifyVoter(\XoopsUser $user = null): bool
    {
        if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
            \xoops_loadLanguage('main', 'xoopspoll');
            $xoopsMailer = \xoops_getMailer();
Severity: Minor
Found in class/Poll.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

delete accesses the super-global variable $GLOBALS.
Open

     */    public function delete(): mixed
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated since Xoopspoll 1.40, please use PollHandler::' . __METHOD__ . ' instead.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}");
        $pollHandler = $this->getStaticPollHandler();
Severity: Minor
Found in class/Poll.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

isResultVisible accesses the super-global variable $GLOBALS.
Open

    public function isResultVisible()
    {
        $visibleMsg = '';
        \xoops_loadLanguage('main', 'xoopspoll');
        switch ($this->getVar('visibility')) {
Severity: Minor
Found in class/Poll.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

getStaticPollHandler accesses the super-global variable $GLOBALS.
Open

    private function getStaticPollHandler()
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated since Xoopspoll 1.40, please use Poll and PollHandler classes instead.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}");
        static $pH;
Severity: Minor
Found in class/Poll.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

notifyVoter accesses the super-global variable $GLOBALS.
Open

    public function notifyVoter(\XoopsUser $user = null): bool
    {
        if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
            \xoops_loadLanguage('main', 'xoopspoll');
            $xoopsMailer = \xoops_getMailer();
Severity: Minor
Found in class/Poll.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

isResultVisible accesses the super-global variable $GLOBALS.
Open

    public function isResultVisible()
    {
        $visibleMsg = '';
        \xoops_loadLanguage('main', 'xoopspoll');
        switch ($this->getVar('visibility')) {
Severity: Minor
Found in class/Poll.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

notifyVoter accesses the super-global variable $GLOBALS.
Open

    public function notifyVoter(\XoopsUser $user = null): bool
    {
        if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
            \xoops_loadLanguage('main', 'xoopspoll');
            $xoopsMailer = \xoops_getMailer();
Severity: Minor
Found in class/Poll.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

notifyVoter accesses the super-global variable $GLOBALS.
Open

    public function notifyVoter(\XoopsUser $user = null): bool
    {
        if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
            \xoops_loadLanguage('main', 'xoopspoll');
            $xoopsMailer = \xoops_getMailer();
Severity: Minor
Found in class/Poll.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

notifyVoter accesses the super-global variable $GLOBALS.
Open

    public function notifyVoter(\XoopsUser $user = null): bool
    {
        if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
            \xoops_loadLanguage('main', 'xoopspoll');
            $xoopsMailer = \xoops_getMailer();
Severity: Minor
Found in class/Poll.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 Poll.php has 343 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);

namespace XoopsModules\Xoopspoll;

/*
Severity: Minor
Found in class/Poll.php - About 4 hrs to fix

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

    class Poll extends \XoopsObject
    {
        private int    $poll_id;
        private string $question;
        private string $description;
    Severity: Minor
    Found in class/Poll.php by phpmd

    Method renderForm has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
        {
            \xoops_load('xoopsformloader');
            $myts = \MyTextSanitizer::getInstance();
    
    
    Severity: Major
    Found in class/Poll.php - About 3 hrs to fix

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

          public function vote(int $optionId, string $ip, int $time): bool
          {
              if (!empty($optionId) && $this->isAllowedToVote()) {
                  $voteTime      = empty($time) ? \time() : (int)$time;
                  $uid           = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) ? $GLOBALS['xoopsUser']->uid() : 0;
      Severity: Minor
      Found in class/Poll.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 notifyVoter has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function notifyVoter(\XoopsUser $user = null): bool
          {
              if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
                  \xoops_loadLanguage('main', 'xoopspoll');
                  $xoopsMailer = \xoops_getMailer();
      Severity: Minor
      Found in class/Poll.php - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method notifyVoter has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function notifyVoter(\XoopsUser $user = null): bool
          {
              if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
                  \xoops_loadLanguage('main', 'xoopspoll');
                  $xoopsMailer = \xoops_getMailer();
      Severity: Major
      Found in class/Poll.php - About 2 hrs to fix

        The class Poll has 16 fields. Consider redesigning Poll to keep the number of fields under 15.
        Open

        class Poll extends \XoopsObject
        {
            private int    $poll_id;
            private string $question;
            private string $description;
        Severity: Minor
        Found in class/Poll.php by phpmd

        TooManyFields

        Since: 0.1

        Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

        Example

        class Person {
           protected $one;
           private $two;
           private $three;
           [... many more fields ...]
        }

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

        Method vote has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function vote(int $optionId, string $ip, int $time): bool
            {
                if (!empty($optionId) && $this->isAllowedToVote()) {
                    $voteTime      = empty($time) ? \time() : (int)$time;
                    $uid           = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) ? $GLOBALS['xoopsUser']->uid() : 0;
        Severity: Minor
        Found in class/Poll.php - About 1 hr to fix

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

              public function __construct($id = null)
              {
                  parent::__construct();
                  //        $timestamp = xoops_getUserTimestamp(time());
                  $currentTimestamp = \time();
          Severity: Minor
          Found in class/Poll.php - About 1 hr to fix

            Method isResultVisible has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function isResultVisible()
                {
                    $visibleMsg = '';
                    \xoops_loadLanguage('main', 'xoopspoll');
                    switch ($this->getVar('visibility')) {
            Severity: Minor
            Found in class/Poll.php - About 1 hr to fix

              Function isResultVisible has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function isResultVisible()
                  {
                      $visibleMsg = '';
                      \xoops_loadLanguage('main', 'xoopspoll');
                      switch ($this->getVar('visibility')) {
              Severity: Minor
              Found in class/Poll.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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function __construct($id = null)
                  {
                      parent::__construct();
                      //        $timestamp = xoops_getUserTimestamp(time());
                      $currentTimestamp = \time();
              Severity: Minor
              Found in class/Poll.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

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

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.php by phpmd

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

                  public function vote(int $optionId, string $ip, int $time): bool
                  {
                      if (!empty($optionId) && $this->isAllowedToVote()) {
                          $voteTime      = empty($time) ? \time() : (int)$time;
                          $uid           = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) ? $GLOBALS['xoopsUser']->uid() : 0;
              Severity: Minor
              Found in class/Poll.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 isResultVisible() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
              Open

                  public function isResultVisible()
                  {
                      $visibleMsg = '';
                      \xoops_loadLanguage('main', 'xoopspoll');
                      switch ($this->getVar('visibility')) {
              Severity: Minor
              Found in class/Poll.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 notifyVoter() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
              Open

                  public function notifyVoter(\XoopsUser $user = null): bool
                  {
                      if (($user instanceof \XoopsUser) && (Constants::MAIL_POLL_TO_VOTER === $this->getVar('mail_voter'))) {
                          \xoops_loadLanguage('main', 'xoopspoll');
                          $xoopsMailer = \xoops_getMailer();
              Severity: Minor
              Found in class/Poll.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 class Poll has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13.
              Open

              class Poll extends \XoopsObject
              {
                  private int    $poll_id;
                  private string $question;
                  private string $description;
              Severity: Minor
              Found in class/Poll.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

              Missing class import via use statement (line '164', column '33').
              Open

                              $criteria = new \CriteriaCompo();
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '165', column '36').
              Open

                              $criteria->add(new \Criteria('option_id', '(' . \implode(',', $optsIdArray) . ')', 'IN'));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                      $criteria       = new \CriteriaCompo();
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                      $criteria->add(new \Criteria('com_itemid', $this->getVar('poll_id'), '='));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                      $criteria->add(new \Criteria('com_modid', $pollModule->getVar('mid'), '='));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '90', column '60').
              Open

                              $this->assignVars($pollHandler->getAll(new \Criteria('id', $id, '=')), null, false);
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '358', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormHidden('user_id', $this->getVar('user_id')));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '359', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormButtonTray('submit', _SUBMIT, null, null, true));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '336', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormLabel(\_AM_XOOPSPOLL_PREFERENCES, "<hr class='center'>"));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '337', column '26').
              Open

                      $visSelect = new \XoopsFormSelect(\_AM_XOOPSPOLL_BLIND, 'visibility', $this->getVar('visibility'), 1, false);
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '276', column '30').
              Open

                      $desc_text     = new \XoopsFormEditor(\_AM_XOOPSPOLL_POLLDESC, 'description', $editorConfigs);
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                      $pollForm    = new \XoopsThemeForm(\ucwords($formTitle), 'poll_form', $rtnPage, $rtnMethod, $rtnSecurity);
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '328', column '27').
              Open

                      $multiLimit = new \XoopsFormText(\_AM_XOOPSPOLL_MULTI_LIMIT . '<br><small>' . \_AM_XOOPSPOLL_MULTI_LIMIT_DESC . '</small>', 'multilimit', 6, 5, $this->getVar('multilimit'));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                      $authorLabel = new \XoopsFormLabel(\_AM_XOOPSPOLL_AUTHOR, "<a href='" . $GLOBALS['xoops']->url('userinfo.php') . '?uid=' . $this->getVar('user_id') . "' target='_blank'>" . \ucfirst(\XoopsUser::getUnameFromId($this->getVar('user_id'))) . '</a>');
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '354', column '39').
              Open

                          $pollForm->addElement(new \XoopsFormHidden($key, $value));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '310', column '39').
              Open

                          $endTimeText        = new \XoopsFormLabel("<div class='bold middle'>" . \_AM_XOOPSPOLL_EXPIRATION, \sprintf(\_AM_XOOPSPOLL_EXPIREDAT, $xuEndFormattedTime) . "<br><a href='{$rtnPage}?{$query}'>" . \_AM_XOOPSPOLL_RESTART . '</a></div>');
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '356', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormHidden('op', 'update'));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '279', column '23').
              Open

                      $author = new \XoopsUser($this->getVar('user_id'));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '323', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormLabel(\_AM_XOOPSPOLL_OPTION_SETTINGS, "<hr class='center'>"));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '325', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormRadioYN(\_AM_XOOPSPOLL_ALLOWMULTI, 'multiple', $this->getVar('multiple')));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '351', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormRadioYN(\_AM_XOOPSPOLL_DISPLAYBLOCK, 'display', $this->getVar('display')));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '431', column '27').
              Open

                          $author = new \XoopsUser($this->getVar('user_id'));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

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

                      $questionText = new \XoopsFormText(\_AM_XOOPSPOLL_POLLQUESTION, 'question', 50, 255, $this->getVar('question', 'E'));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '348', column '30').
              Open

                      $mail_voter_yn = new \XoopsFormRadioYN(\_AM_XOOPSPOLL_NOTIFY_VOTER, 'mail_voter', $this->getVar('mail_voter'));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '357', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormHidden('poll_id', $this->getVar('poll_id')));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '345', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormRadioYN(\_AM_XOOPSPOLL_NOTIFY, 'notify', $notifyValue));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '244', column '35').
              Open

                      $pollForm->addElement(new \XoopsFormText(\_AM_XOOPSPOLL_DISPLAYORDER, 'weight', 6, 5, $this->getVar('weight')));
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '282', column '25').
              Open

                      $timeTray = new \XoopsFormElementTray(\_AM_XOOPSPOLL_POLL_TIMES, '&nbsp;&nbsp;', 'time_tray');
              Severity: Minor
              Found in class/Poll.php by phpmd

              MissingImport

              Since: 2.7.0

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

              Example

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

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

              Missing class import via use statement (line '320', column '21').
              Open

                      $temp = new \XoopsFormRadioYN(\_AM_XOOPSPOLL_ALLOWANONYMOUS, 'anonymous', $this->getVar('anonymous'));
              Severity: Minor
              Found in class/Poll.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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              \trigger_error($errorMsg, \E_USER_WARNING);
                          }
              Severity: Minor
              Found in class/Poll.php by phpmd

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                          } else {
                              $pollHandler = Helper::getInstance()->getHandler('Poll');
                              $this->assignVars($pollHandler->getAll(new \Criteria('id', $id, '=')), null, false);
                              unset($pollHandler);
                          }
              Severity: Minor
              Found in class/Poll.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 '\MyTextSanitizer' in method 'renderForm'.
              Open

                      $myts = \MyTextSanitizer::getInstance();
              Severity: Minor
              Found in class/Poll.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 renderForm uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $endTimeText = new FormDateTimePicker("<div class='bold middle'>" . \_AM_XOOPSPOLL_EXPIRATION . '</div>', 'xu_end_time', 20, $xuEndTimestamp);
                      }
              Severity: Minor
              Found in class/Poll.php by phpmd

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                          } else {
                              $xoopsMailer->assign('LOCATION', '');
                          }
              Severity: Minor
              Found in class/Poll.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\Xoopspoll\Utility' in method 'renderForm'.
              Open

                      $visSelect->addOptionArray(Utility::getVisibilityArray());
              Severity: Minor
              Found in class/Poll.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 isResultVisible uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                              } else {
                                  $visibleMsg = \_MD_XOOPSPOLL_HIDE_VOTED_MSG;
                                  $isVisible  = false;
                              }
              Severity: Minor
              Found in class/Poll.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 '\XoopsUser' in method 'renderForm'.
              Open

                      $authorLabel = new \XoopsFormLabel(\_AM_XOOPSPOLL_AUTHOR, "<a href='" . $GLOBALS['xoops']->url('userinfo.php') . '?uid=' . $this->getVar('user_id') . "' target='_blank'>" . \ucfirst(\XoopsUser::getUnameFromId($this->getVar('user_id'))) . '</a>');
              Severity: Minor
              Found in class/Poll.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 isResultVisible uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                              } else {
                                  $visibleMsg = \_MD_XOOPSPOLL_HIDE_END_MSG;
                                  $isVisible  = false;
                              }
              Severity: Minor
              Found in class/Poll.php by phpmd

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                      } else {
                          $status = false;
                      }
              Severity: Minor
              Found in class/Poll.php by phpmd

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                          } else {
                              $xoopsMailer->assign('POLL_END', \sprintf(\_MD_XOOPSPOLL_ENDS_ON, $xuEndFormattedTime));
                          }
              Severity: Minor
              Found in class/Poll.php by phpmd

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                      } else {
                          $formTitle = \_AM_XOOPSPOLL_EDITPOLL;
                      }
              Severity: Minor
              Found in class/Poll.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\Xoopspoll\Helper' in method 'notifyVoter'.
              Open

                          $helper = Helper::getInstance();
              Severity: Minor
              Found in class/Poll.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 private fields such as '$votes'.
              Open

                  private int    $votes;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$user_id'.
              Open

                  private int    $user_id;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$multiple'.
              Open

                  private int    $multiple;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$question'.
              Open

                  private string $question;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$end_time'.
              Open

                  private int    $end_time;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$weight'.
              Open

                  private int    $weight;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$poll_id'.
              Open

                  private int    $poll_id;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$start_time'.
              Open

                  private int    $start_time;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$display'.
              Open

                  private int    $display;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$description'.
              Open

                  private string $description;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$visibility'.
              Open

                  private int    $visibility;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$anonymous'.
              Open

                  private int    $anonymous;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$voters'.
              Open

                  private int    $voters;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$mail_status'.
              Open

                  private int    $mail_status;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$multilimit'.
              Open

                  private int    $multilimit;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

              Avoid unused private fields such as '$mail_voter'.
              Open

                  private int    $mail_voter;
              Severity: Minor
              Found in class/Poll.php by phpmd

              UnusedPrivateField

              Since: 0.2

              Detects when a private field is declared and/or assigned a value, but not used.

              Example

              class Something
              {
                  private static $FOO = 2; // Unused
                  private $i = 5; // Unused
                  private $j = 6;
                  public function addOne()
                  {
                      return $this->j++;
                  }
              }

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

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

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

                      $author = new \XoopsUser($this->getVar('user_id'));
              Severity: Minor
              Found in class/Poll.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 '$pollModule'.
              Open

                      $pollModule    = $moduleHandler->getByDirname('xoopspoll');
              Severity: Minor
              Found in class/Poll.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 '$multiCount'.
              Open

                      $multiCount = ($this->getVar('multiple') > 0) ? $this->getVar('multiple') : '';
              Severity: Minor
              Found in class/Poll.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 variables with short names like $id. Configured minimum length is 3.
              Open

                  public function __construct($id = null)
              Severity: Minor
              Found in class/Poll.php by phpmd

              ShortVariable

              Since: 0.2

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

              Example

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

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

              The property $poll_id is not named in camelCase.
              Open

              class Poll extends \XoopsObject
              {
                  private int    $poll_id;
                  private string $question;
                  private string $description;
              Severity: Minor
              Found in class/Poll.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The property $mail_voter is not named in camelCase.
              Open

              class Poll extends \XoopsObject
              {
                  private int    $poll_id;
                  private string $question;
                  private string $description;
              Severity: Minor
              Found in class/Poll.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

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

                  public function vote(int $optionId, string $ip, int $time): bool
              Severity: Minor
              Found in class/Poll.php by phpmd

              ShortVariable

              Since: 0.2

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

              Example

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

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

              The property $user_id is not named in camelCase.
              Open

              class Poll extends \XoopsObject
              {
                  private int    $poll_id;
                  private string $question;
                  private string $description;
              Severity: Minor
              Found in class/Poll.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The property $mail_status is not named in camelCase.
              Open

              class Poll extends \XoopsObject
              {
                  private int    $poll_id;
                  private string $question;
                  private string $description;
              Severity: Minor
              Found in class/Poll.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The property $end_time is not named in camelCase.
              Open

              class Poll extends \XoopsObject
              {
                  private int    $poll_id;
                  private string $question;
                  private string $description;
              Severity: Minor
              Found in class/Poll.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              The property $start_time is not named in camelCase.
              Open

              class Poll extends \XoopsObject
              {
                  private int    $poll_id;
                  private string $question;
                  private string $description;
              Severity: Minor
              Found in class/Poll.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

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

                      static $pH;
              Severity: Minor
              Found in class/Poll.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 28 and the first side effect is on line 23.
              Open

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

              Opening brace indented incorrectly; expected 0 spaces, found 4
              Open

                  {
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 254 characters
              Open

                      $authorLabel = new \XoopsFormLabel(\_AM_XOOPSPOLL_AUTHOR, "<a href='" . $GLOBALS['xoops']->url('userinfo.php') . '?uid=' . $this->getVar('user_id') . "' target='_blank'>" . \ucfirst(\XoopsUser::getUnameFromId($this->getVar('user_id'))) . '</a>');
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 196 characters
              Open

                          $errorMsg = __CLASS__ . " instantiation with 'id' set is deprecated since Xoopspoll 1.40, please use PollHandler instead." . " Called from {$trace[0]['file']}line {$trace[0]['line']}";
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 181 characters
              Open

                      $multiLimit = new \XoopsFormText(\_AM_XOOPSPOLL_MULTI_LIMIT . '<br><small>' . \_AM_XOOPSPOLL_MULTI_LIMIT_DESC . '</small>', 'multilimit', 6, 5, $this->getVar('multilimit'));
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 150 characters
              Open

                      $notifyValue = (Constants::POLL_MAILED !== $this->getVar('mail_status')) ? Constants::NOTIFICATION_ENABLED : Constants::NOTIFICATION_DISABLED;
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 247 characters
              Open

                          $endTimeText        = new \XoopsFormLabel("<div class='bold middle'>" . \_AM_XOOPSPOLL_EXPIRATION, \sprintf(\_AM_XOOPSPOLL_EXPIREDAT, $xuEndFormattedTime) . "<br><a href='{$rtnPage}?{$query}'>" . \_AM_XOOPSPOLL_RESTART . '</a></div>');
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 230 characters
              Open

                      $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated since Xoopspoll 1.40, please use Poll and PollHandler classes instead.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}");
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 126 characters
              Open

                              $descTarea = new \XoopsFormTextarea(_AM_XOOPSPOLL_POLLDESC, "description", $this->getVar('description', 'E'));
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 223 characters
              Open

                      $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated since Xoopspoll 1.40, please use PollHandler::insert() instead.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}");
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 285 characters
              Open

                      $startTimeText = new FormDateTimePicker("<div class='bold'>" . \_AM_XOOPSPOLL_START_TIME . '<br>' . "<span class='x-small'>" . \_AM_XOOPSPOLL_FORMAT . '<br>' . \sprintf(\_AM_XOOPSPOLL_CURRENTTIME, $xuCurrentFormatted) . '</span></div>', 'xu_start_time', 20, $xuStartTimestamp);
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 121 characters
              Open

                                             && ($GLOBALS['xoopsUser']->getVar('uid') > 0)) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 233 characters
              Open

                      $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated since Xoopspoll 1.40, please use PollHandler::' . __METHOD__ . ' instead.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}");
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 134 characters
              Open

                      //        $pollForm->addElement(new \XoopsFormRadioYN(_AM_XOOPSPOLL_ALLOWANONYMOUS, 'anonymous', $this->getVar('anonymous')));
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 146 characters
              Open

                              $xoopsMailer->assign('LOCATION', $GLOBALS['xoops']->url('modules/xoopspoll/pollresults.php?poll_id=' . $this->getVar('poll_id')));
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 154 characters
              Open

                          $endTimeText = new FormDateTimePicker("<div class='bold middle'>" . \_AM_XOOPSPOLL_EXPIRATION . '</div>', 'xu_end_time', 20, $xuEndTimestamp);
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 233 characters
              Open

                      $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated since Xoopspoll 1.40, please use PollHandler::' . __METHOD__ . ' instead.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}");
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 127 characters
              Open

                          $xoopsMailer->setSubject(\sprintf(\_MD_XOOPSPOLL_YOURVOTEAT, $user->uname(), $GLOBALS['xoopsConfig']['sitename']));
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 125 characters
              Open

                      $questionText = new \XoopsFormText(\_AM_XOOPSPOLL_POLLQUESTION, 'question', 50, 255, $this->getVar('question', 'E'));
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line exceeds 120 characters; contains 121 characters
              Open

                                                     . $this->getVar('poll_id') . "{$extra}'>" . _AM_XOOPSPOLL_RESTART . "</a></div>");
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line indented incorrectly; expected 0 spaces, found 4
              Open

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

              Line indented incorrectly; expected 0 spaces, found 4
              Open

                  public function updateCount()
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line indented incorrectly; expected 0 spaces, found 4
              Open

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

              Closing brace indented incorrectly; expected 0 spaces, found 4
              Open

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

              Line indented incorrectly; expected 0 spaces, found 4
              Open

                  private function getStaticPollHandler()
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 0 spaces, found 4
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      static $pH;
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      if (!isset($pH)) {
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              Line indented incorrectly; expected 0 spaces, found 4
              Open

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

              Line indented incorrectly; expected 0 spaces, found 4
              Open

                  public function store(): mixed
              Severity: Minor
              Found in class/Poll.php by phpcodesniffer

              The variable $sys_module is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $sys_config is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $sys_id is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $desc_text is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $mail_voter_yn is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $sys_config is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $sys_id is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $desc_text is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $mail_voter_yn is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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 $sys_module is not named in camelCase.
              Open

                  public function renderForm(string $rtnPage, string $rtnMethod = 'post', array $addHidden = [])
                  {
                      \xoops_load('xoopsformloader');
                      $myts = \MyTextSanitizer::getInstance();
              
              
              Severity: Minor
              Found in class/Poll.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