mambax7/xnewsletter

View on GitHub

Showing 283 of 379 total issues

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

    public function getForm($action = false)
    {
        global $xoopsDB;

        /** @var \XoopsGroupPermHandler $grouppermHandler */
Severity: Minor
Found in class/Cat.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 DKIM_Add has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function DKIM_Add($headers_line, $subject, $body)
    {
        $DKIMsignatureType    = 'rsa-sha256'; // Signature & hash algorithms
        $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
        $DKIMquery            = 'dns/txt'; // Query method
Severity: Major
Found in include/phpmailer/class.phpmailer.php - About 2 hrs to fix

    Method attachAll has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function attachAll($disposition_type, $boundary)
        {
            // Return text of body
            $mime    = [];
            $cidUniq = [];
    Severity: Major
    Found in include/phpmailer/class.phpmailer.php - About 2 hrs to fix

      Function data has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function data($msg_data)
          {
              //This will use the standard timelimit
              if (!$this->sendCommand('DATA', 'DATA', 354)) {
                  return false;
      Severity: Minor
      Found in include/phpmailer/class.smtp.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 xoops_module_install_xnewsletter has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method preSend has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method xnewsletter_largeDownload has 61 lines of code (exceeds 25 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: Major
          Found in include/functions.php - About 2 hrs to fix

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

            function b_xnewsletter_letter($options)
            {
                global $xoopsUser;
                $myts             = \MyTextSanitizer::getInstance();
                /** @var \XoopsGroupPermHandler $grouppermHandler */
            Severity: Minor
            Found in blocks/blocks_letter.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 createHeader has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function createHeader()
                {
                    $result = '';
            
                    $result .= $this->headerLine('Date', '' == $this->MessageDate ? self::rfcDate() : $this->MessageDate);
            Severity: Major
            Found in include/phpmailer/class.phpmailer.php - About 2 hrs to fix

              File subscr.php has 262 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

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

                    public static function validateAddress($address, $patternselect = null)
                    {
                        if (null === $patternselect) {
                            $patternselect = self::$validator;
                        }
                Severity: Minor
                Found in include/phpmailer/class.phpmailer.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 smtpSend has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function smtpSend($header, $body)
                    {
                        $bad_rcpt = [];
                        if (!$this->smtpConnect($this->SMTPOptions)) {
                            throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
                Severity: Minor
                Found in include/phpmailer/class.phpmailer.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 parseHelloFields has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function parseHelloFields($type)
                    {
                        $this->server_caps = [];
                        $lines             = explode("\n", $this->helo_rply);
                
                
                Severity: Minor
                Found in include/phpmailer/class.smtp.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 validateAddress has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function validateAddress($address, $patternselect = null)
                    {
                        if (null === $patternselect) {
                            $patternselect = self::$validator;
                        }
                Severity: Major
                Found in include/phpmailer/class.phpmailer.php - About 2 hrs to fix

                  Method tln_fixurl has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function tln_fixurl($attname, &$attvalue, $trans_image_path, $block_external_images)
                  {
                      $sQuote   = '"';
                      $attvalue = trim($attvalue);
                      if ($attvalue && ('"' == $attvalue[0] || "'" == $attvalue[0])) {
                  Severity: Major
                  Found in include/phpmailer/extras/htmlfilter.php - About 2 hrs to fix

                    Method b_xnewsletter_letter has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function b_xnewsletter_letter($options)
                    {
                        global $xoopsUser;
                        $myts             = \MyTextSanitizer::getInstance();
                        /** @var \XoopsGroupPermHandler $grouppermHandler */
                    Severity: Major
                    Found in blocks/blocks_letter.php - About 2 hrs to fix

                      Method xoops_module_update_xnewsletter_141 has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function xoops_module_update_xnewsletter_141()
                      {
                          global $xoopsDB;
                      
                          $helper = \XoopsModules\Xnewsletter\Helper::getInstance();
                      Severity: Major
                      Found in include/onupdate.php - About 2 hrs to fix

                        Function xnewsletter_plugin_getdata_simplenewsletter has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function xnewsletter_plugin_getdata_simplenewsletter($cat_id, $action_after_read, $limitcheck, $skipcatsubscrexist) {
                            global $xoopsDB;
                            $helper = \XoopsModules\Xnewsletter\Helper::getInstance();
                        
                            $import_status = (0 == $action_after_read) ? 1 : 0;
                        Severity: Minor
                        Found in plugins/simplenewsletter.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 tln_fixatts has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function tln_fixatts(
                            $tagname,
                            $attary,
                            $rm_attnames,
                            $bad_attvals,
                        Severity: Major
                        Found in include/phpmailer/extras/htmlfilter.php - About 2 hrs to fix

                          Method xnewsletter_getUserPermissionsByLetter has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function xnewsletter_getUserPermissionsByLetter($letter_id = 0)
                          {
                              global $xoopsUser;
                              /** @var \XoopsGroupPermHandler $grouppermHandler */
                              $grouppermHandler = xoops_getHandler('groupperm');
                          Severity: Major
                          Found in include/functions.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language