mambax7/xnewsletter

View on GitHub

Showing 283 of 379 total issues

Function processBounce has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function processBounce($pos, $type, $totalFetched)
    {
        $header  = imap_headerinfo($this->_mailbox_link, $pos);
        $subject = strip_tags($header->subject);
        if ('DSN' === $type) {
Severity: Minor
Found in include/phpmailer_bmh/class.phpmailer-bmh.php - About 3 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Method getSearchForm has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getSearchForm($plugin, $action_after_read = 1, $limitcheck = 0, $action = false)
    {
        global $xoopsDB;

        if (false === $action) {
Severity: Major
Found in class/Import.php - About 3 hrs to fix

    Method iterate_over_node has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function iterate_over_node($node)
    {
        if ($node instanceof DOMText) {
            return preg_replace('/\\s+/im', ' ', $node->wholeText);
        }
    Severity: Major
    Found in include/html2text/html2text.php - About 3 hrs to fix

      Method authenticate has 90 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function authenticate(
              $username,
              $password,
              $authtype = null,
              $realm = '',
      Severity: Major
      Found in include/phpmailer/class.smtp.php - About 3 hrs to fix

        Function parseAddresses has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

            public function parseAddresses($addrstr, $useimap = true)
            {
                $addresses = [];
                if ($useimap and function_exists('imap_rfc822_parse_adrlist')) {
                    //Use this built-in parser if it's available
        Severity: Minor
        Found in include/phpmailer/class.phpmailer.php - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function xoops_module_install_xnewsletter has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

        function xoops_module_install_xnewsletter(\XoopsModule $module)
        {
            require_once dirname(__DIR__) . '/preloads/autoloader.php';
        
            // get module config values
        Severity: Minor
        Found in include/oninstall.php - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function getForm has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getForm($action = false, $admin_aerea = false)
            {
                global $xoopsDB, $xoopsUser, $pathImageIcon;
        
                if (false === $action) {
        Severity: Minor
        Found in class/Letter.php - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method xnewsletter_setPost has 86 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function xnewsletter_setPost($contentObj, $sets)
        {
            if (!is_object($contentObj)) {
                return false;
            }
        Severity: Major
        Found in include/functions.php - About 3 hrs to fix

          Function preSend has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

              public function preSend()
              {
                  try {
                      $this->error_count = 0; // Reset errors
                      $this->mailHeader  = '';
          Severity: Minor
          Found in include/phpmailer/class.phpmailer.php - About 3 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function iterate_over_node has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          function iterate_over_node($node)
          {
              if ($node instanceof DOMText) {
                  return preg_replace('/\\s+/im', ' ', $node->wholeText);
              }
          Severity: Minor
          Found in include/html2text/html2text.php - About 3 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function xnewsletter_largeDownload has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          function xnewsletter_largeDownload($filePath, $fileMimetype)
          {
              /* You may need these ini settings too */
              set_time_limit(0);
              ini_set('memory_limit', '512M');
          Severity: Minor
          Found in include/functions.php - About 3 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          File onupdate.php has 304 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * ****************************************************************************
           *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
           * ****************************************************************************
          Severity: Minor
          Found in include/onupdate.php - About 3 hrs to fix

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

                protected function _convert_blockquotes(&$text)
                {
                    if (preg_match_all('/<\/*blockquote[^>]*>/i', $text, $matches, PREG_OFFSET_CAPTURE)) {
                        $start  = 0;
                        $taglen = 0;
            Severity: Minor
            Found in include/phpmailer/extras/class.html2text.php - About 3 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

            Method smtpConnect has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function smtpConnect($options = null)
                {
                    if (null === $this->smtp) {
                        $this->smtp = $this->getSMTPInstance();
                    }
            Severity: Major
            Found in include/phpmailer/class.phpmailer.php - About 3 hrs to fix

              Method getForm has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getForm($action = false)
                  {
                      global $xoopsDB, $xoopsUser;
              
                      if (false === $action) {
              Severity: Major
              Found in class/Subscr.php - About 3 hrs to fix

                Function sendmailSend has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function sendmailSend($header, $body)
                    {
                        // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
                        if (!empty($this->Sender) and self::isShellSafe($this->Sender)) {
                            if ('qmail' == $this->Mailer) {
                Severity: Minor
                Found in include/phpmailer/class.phpmailer.php - About 3 hrs to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function deleteDirectory has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function deleteDirectory($src)
                    {
                        // Only continue if user is a 'global' Admin
                        if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                            return false;
                Severity: Minor
                Found in class/Common/FilesManagement.php - About 3 hrs to fix

                Cognitive Complexity

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

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

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

                Further reading

                Method wrapText has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function wrapText($message, $length, $qp_mode = false)
                    {
                        if ($qp_mode) {
                            $soft_break = sprintf(' =%s', $this->LE);
                        } else {
                Severity: Major
                Found in include/phpmailer/class.phpmailer.php - About 3 hrs to fix

                  Function checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function checkVerModule($helper, $source = 'github', $default = 'master')
                      {
                          $moduleDirName      = basename(dirname(dirname(__DIR__)));
                          $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                          $update             = '';
                  Severity: Minor
                  Found in class/Common/VersionChecks.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 getForm has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getForm($action = false)
                      {
                          global $xoopsDB, $xoopsUser;
                  
                          if (false === $action) {
                  Severity: Minor
                  Found in class/Subscr.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

                  Severity
                  Category
                  Status
                  Source
                  Language