mambax7/xnewsletter

View on GitHub

Showing 283 of 379 total issues

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

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

        if (false === $action) {
Severity: Minor
Found in class/Catsubscr.php - About 1 hr to fix

    Method parseAddresses has 37 lines of code (exceeds 25 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 1 hr to fix

      Method _convert_blockquotes has 37 lines of code (exceeds 25 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 1 hr to fix

        Method getMailMIME has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getMailMIME()
            {
                $result      = '';
                $ismultipart = true;
                switch ($this->message_type) {
        Severity: Minor
        Found in include/phpmailer/class.phpmailer.php - About 1 hr to fix

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

          function xoops_module_update_xnewsletter_103()
          {
              global $xoopsDB;
          
              $sql    = sprintf('DROP TABLE IF EXISTS `' . $xoopsDB->prefix('mod_xnewsletter_import') . '`');
          Severity: Minor
          Found in include/onupdate.php - About 1 hr to fix

            Function addAnAddress has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function addAnAddress($kind, $address, $name = '')
                {
                    if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'], true)) {
                        $error_message = $this->lang('Invalid recipient kind: ') . $kind;
                        $this->setError($error_message);
            Severity: Minor
            Found in include/phpmailer/class.phpmailer.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 tln_body2div has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function tln_body2div($attary, $trans_image_path)
            {
                $divattary   = ['class' => "'bodyclass'"];
                $text        = '#000000';
                $has_bgc_stl = $has_txt_stl = false;
            Severity: Minor
            Found in include/phpmailer/extras/htmlfilter.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 setError has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function setError($msg)
                {
                    $this->error_count++;
                    if ('smtp' == $this->Mailer and null !== $this->smtp) {
                        $lasterror = $this->smtp->getError();
            Severity: Minor
            Found in include/phpmailer/class.phpmailer.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 delete has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function delete(\XoopsObject $subscrObj, $force = false)
                {
                    $res       = true;
                    $subscr_id = (int)$subscrObj->getVar('subscr_id');
                    // delete subscriptions ({@link catsubscr} objects)
            Severity: Minor
            Found in class/SubscrHandler.php - About 1 hr to fix

            Cognitive Complexity

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

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

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

            Further reading

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

            function xnewsletter_CleanVars($global, $key, $default = '', $type = 'int', $notset = false)
            {
                require_once XOOPS_ROOT_PATH . '/include/functions.php';
                switch ($type) {
                    case 'string':
            Severity: Minor
            Found in include/functions.php - About 1 hr to fix

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

                  public function getForm($action = false)
                  {
                      global $xoopsDB;
              
                      if (false === $action) {
              Severity: Minor
              Found in class/Bmh.php - About 1 hr to fix

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

                    public function getValuesAccount($keys = null, $format = null, $maxDepth = null)
                    {
                        $ret = $this->getValues($keys, $format, $maxDepth);
                        $ret['id'] = $this->getVar('accounts_id');
                        $accounts_types = [
                Severity: Minor
                Found in class/Accounts.php - About 1 hr to fix

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

                      public static function mb_pathinfo($path, $options = null)
                      {
                          $ret      = ['dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''];
                          $pathinfo = [];
                          if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
                  Severity: Minor
                  Found in include/phpmailer/class.phpmailer.php - About 1 hr to fix

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

                        protected function mailSend($header, $body)
                        {
                            $toArr = [];
                            foreach ($this->to as $toaddr) {
                                $toArr[] = $this->addrFormat($toaddr);
                    Severity: Minor
                    Found in include/phpmailer/class.phpmailer.php - About 1 hr to fix

                      Function DKIM_Sign has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function DKIM_Sign($signHeader)
                          {
                              if (!defined('PKCS7_TEXT')) {
                                  if ($this->exceptions) {
                                      throw new phpmailerException($this->lang('extension_missing') . 'openssl');
                      Severity: Minor
                      Found in include/phpmailer/class.phpmailer.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 mailSend has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function mailSend($header, $body)
                          {
                              $toArr = [];
                              foreach ($this->to as $toaddr) {
                                  $toArr[] = $this->addrFormat($toaddr);
                      Severity: Minor
                      Found in include/phpmailer/class.phpmailer.php - About 1 hr to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Method tln_sanitize has 10 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          $body,
                          $tag_list,
                          $rm_tags_with_content,
                          $self_closing_tags,
                          $force_tag_closing,
                      Severity: Major
                      Found in include/phpmailer/extras/htmlfilter.php - About 1 hr to fix

                        Function mailbox_exist has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function mailbox_exist($mailbox, $create = true)
                            {
                                if ('' == trim($mailbox) || false === mb_strpos($mailbox, 'INBOX.')) {
                                    // this is a critical error with either the mailbox name blank or an invalid mailbox name
                                    // need to stop processing and exit at this point
                        Severity: Minor
                        Found in include/phpmailer_bmh/class.phpmailer-bmh.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 getForm has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function getForm($action = false)
                            {
                                global $xoopsDB;
                        
                                if (false === $action) {
                        Severity: Minor
                        Found in class/Accounts.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 rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function rrmdir($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 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

                        Severity
                        Category
                        Status
                        Source
                        Language