mambax7/xnewsletter

View on GitHub

Showing 283 of 379 total issues

Method encodeFile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function encodeFile($path, $encoding = 'base64')
    {
        try {
            if (!is_readable($path)) {
                throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
Severity: Minor
Found in include/phpmailer/class.phpmailer.php - About 1 hr to fix

    Method addOrEnqueueAnAddress has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function addOrEnqueueAnAddress($kind, $address, $name)
        {
            $address = trim($address);
            $name    = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
            if (false === ($pos = mb_strrpos($address, '@'))) {
    Severity: Minor
    Found in include/phpmailer/class.phpmailer.php - About 1 hr to fix

      Method mailbox_exist has 27 lines of code (exceeds 25 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

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

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

          Method _build_link_list has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _build_link_list($link, $display, $link_override = null)
              {
                  $link_method = $link_override ?: $this->_options['do_links'];
                  if ('none' === $link_method) {
                      return $display;
          Severity: Minor
          Found in include/phpmailer/extras/class.html2text.php - About 1 hr to fix

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

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

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

                Method getValuesMailinglist has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getValuesMailinglist($keys = null, $format = null, $maxDepth = null)
                    {
                        $ret['id']          = $this->getVar('mailinglist_id');
                        $ret['name']        = $this->getVar('mailinglist_name');
                        $ret['email']       = $this->getVar('mailinglist_email');
                Severity: Minor
                Found in class/Mailinglist.php - About 1 hr to fix

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

                      public static function rmove($src, $dest)
                      {
                          // 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 55 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      public static function recurseCopy($src, $dst)
                      {
                          $dir = opendir($src);
                          //        @mkdir($dst);
                          if (!@mkdir($dst) && !is_dir($dst)) {
                  Severity: Minor
                  Found in class/Common/FilesManagement.php - About 55 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      public static function rcopy($src, $dest)
                      {
                          // 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 55 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Method xnewsletter_plugin_getdata_csv has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      $cat_id,
                      $action_after_read,
                      $limitCheck,
                      $skipCatsubscrExist,
                      $file,
                  Severity: Major
                  Found in plugins/csv.php - About 50 mins to fix

                    Method tln_fixatts has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        $tagname,
                        $attary,
                        $rm_attnames,
                        $bad_attvals,
                        $add_attr_to_tag,
                    Severity: Major
                    Found in include/phpmailer/extras/htmlfilter.php - About 50 mins to fix

                      Method doCallback has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from)
                      Severity: Major
                      Found in include/phpmailer/class.phpmailer.php - About 50 mins to fix

                        Method authorise has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
                        Severity: Minor
                        Found in include/phpmailer/class.pop3.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if ($helper->getHandler('Template')->insert($templateObj)) {
                                                  redirect_header('?op=list', 3, _AM_XNEWSLETTER_FORMOK);
                                              }
                          Severity: Major
                          Found in admin/template.php - About 45 mins to fix

                            Method addStringEmbeddedImage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    $string,
                                    $cid,
                                    $name = '',
                                    $encoding = 'base64',
                                    $type = '',
                            Severity: Minor
                            Found in include/phpmailer/class.phpmailer.php - About 45 mins to fix

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

                                  public function encodeQ($str, $position = 'text')
                                  {
                                      // There should not be any EOL in the string
                                      $pattern = '';
                                      $encoded = str_replace(["\r", "\n"], '', $str);
                              Severity: Minor
                              Found in include/phpmailer/class.phpmailer.php - About 45 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

                              Avoid deeply nested control flow statements.
                              Open

                                                          if (count($protocolsAll) > 1) {
                                                              $protocol_status .= "($p) ";
                                                          }
                              Severity: Major
                              Found in admin/protocol.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ($protocolCount > 2) {
                                                            $protocol_status .= '...';
                                                        }
                                Severity: Major
                                Found in admin/protocol.php - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language