mambax7/xnewsletter

View on GitHub

Showing 283 of 379 total issues

Method addAttachment has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
    {
        try {
            if (!@is_file($path)) {
                throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
Severity: Minor
Found in include/phpmailer/class.phpmailer.php - About 1 hr to fix

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

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

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

          Method xnewsletter_plugin_getform_xoopsuser has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function xnewsletter_plugin_getform_xoopsuser($cat_id, $action_after_read, $limitCheck, $skipCatsubscrExist)
          {
              global $xoopsDB;
              $helper        = Xnewsletter\Helper::getInstance();
              $memberHandler = xoops_getHandler('member');
          Severity: Minor
          Found in plugins/xoopsuser.php - About 1 hr to fix

            Method getServerStats has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getServerStats()
                {
                    $moduleDirName      = basename(dirname(dirname(__DIR__)));
                    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                    xoops_loadLanguage('common', $moduleDirName);
            Severity: Minor
            Found in class/Common/ServerStats.php - About 1 hr to fix

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

                Method render has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function render($output = true)
                    {
                        //Add header
                        $ics = 'BEGIN:VCALENDAR
                METHOD:PUBLISH
                Severity: Minor
                Found in include/phpmailer/extras/EasyPeasyICS.php - About 1 hr to fix

                  Method callbackAction has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      $msgnum,
                      $bounce_type,
                      $email,
                      $subject,
                      $xheader,
                  Severity: Major
                  Found in admin/bmh_callback_database.php - About 1 hr to fix

                    Method connect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function connect($host, $port = false, $tval = 30)
                        {
                            //  Are we already connected?
                            if ($this->connected) {
                                return true;
                    Severity: Minor
                    Found in include/phpmailer/class.pop3.php - About 1 hr to fix

                      Method get_lines has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function get_lines()
                          {
                              // If the connection is bad, give up straight away
                              if (!is_resource($this->smtp_conn)) {
                                  return '';
                      Severity: Minor
                      Found in include/phpmailer/class.smtp.php - About 1 hr to fix

                        Method globalDelete has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function globalDelete()
                            {
                                $dateArr = explode('-', $this->deleteMsgDate); // date format is yyyy-mm-dd
                                $delDate = mktime(0, 0, 0, $dateArr[1], $dateArr[2], $dateArr[0]);
                        
                        
                        Severity: Minor
                        Found in include/phpmailer_bmh/class.phpmailer-bmh.php - About 1 hr to fix

                          Method sendCommand has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function sendCommand($command, $commandstring, $expect)
                              {
                                  if (!$this->connected()) {
                                      $this->setError("Called $command without being connected");
                          
                          
                          Severity: Minor
                          Found in include/phpmailer/class.smtp.php - About 1 hr to fix

                            Method xnewsletter_search has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function xnewsletter_search($queryarray, $andor, $limit, $offset, $userid)
                            {
                                global $xoopsDB;
                            
                                $sql = 'SELECT cat_id, cat_name, cat_submitter, cat_created';
                            Severity: Minor
                            Found in include/search.inc.php - About 1 hr to fix

                              Function encodeFile has a Cognitive Complexity of 10 (exceeds 5 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

                              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 _build_link_list has a Cognitive Complexity of 10 (exceeds 5 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

                              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_tagprint has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function tln_tagprint($tagname, $attary, $tagtype)
                              {
                                  if (2 == $tagtype) {
                                      $fulltag = '</' . $tagname . '>';
                                  } else {
                              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 mb_pathinfo has a Cognitive Complexity of 10 (exceeds 5 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

                              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_update_xnewsletter_141 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function xoops_module_update_xnewsletter_141()
                              {
                                  global $xoopsDB;
                              
                                  $helper = \XoopsModules\Xnewsletter\Helper::getInstance();
                              Severity: Minor
                              Found in include/onupdate.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 connect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function connect($host, $port = null, $timeout = 30, $options = [])
                                  {
                                      static $streamok;
                                      //This is enabled by default since 5.0.0 but some providers disable it
                                      //Check this once and cache the result
                              Severity: Minor
                              Found in include/phpmailer/class.smtp.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