mambax7/xnewsletter

View on GitHub

Showing 283 of 379 total issues

Function attachAll has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    protected function attachAll($disposition_type, $boundary)
    {
        // Return text of body
        $mime    = [];
        $cidUniq = [];
Severity: Minor
Found in include/phpmailer/class.phpmailer.php - About 1 day 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 admin.php has 479 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * ****************************************************************************
 *  XNEWSLETTER - MODULE FOR XOOPS
 *  Copyright (c) 2007 - 2012
Severity: Minor
Found in language/english/admin.php - About 7 hrs to fix

    File admin.php has 478 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php   
    /**
     * ****************************************************************************
     *  XNEWSLETTER - MODULE FOR XOOPS
     *  Copyright (c) 2007 - 2012
    Severity: Minor
    Found in language/german/admin.php - About 7 hrs to fix

      File maintenance.php has 475 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/maintenance.php - About 7 hrs to fix

        Function xnewsletter_createTasks has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
        Open

        function xnewsletter_createTasks($op, $letter_id, $xn_send_in_packages, $xn_send_in_packages_time)
        {
            global $xoopsUser, $xoopsDB;
            $helper = Xnewsletter\Helper::getInstance();
        
        
        Severity: Minor
        Found in include/task.inc.php - About 7 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 smtpConnect has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

            public function smtpConnect($options = null)
            {
                if (null === $this->smtp) {
                    $this->smtp = $this->getSMTPInstance();
                }
        Severity: Minor
        Found in include/phpmailer/class.phpmailer.php - About 6 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 createBody has 168 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function createBody()
            {
                $body = '';
                //Create unique IDs and preset boundaries
                $this->uniqueid    = $this->generateId();
        Severity: Major
        Found in include/phpmailer/class.phpmailer.php - About 6 hrs to fix

          Function tln_fixurl has a Cognitive Complexity of 41 (exceeds 5 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: Minor
          Found in include/phpmailer/extras/htmlfilter.php - About 6 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 getForm has 148 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function getSearchForm has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getSearchForm($plugin, $action_after_read = 1, $limitcheck = 0, $action = false)
                {
                    global $xoopsDB;
            
                    if (false === $action) {
            Severity: Minor
            Found in class/Import.php - About 5 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 xoops_version.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              File task.inc.php has 408 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/task.inc.php - About 5 hrs to fix

                Function tln_fixstyle has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                Open

                function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
                {
                    // workaround for </style> in between comments
                    $content = '';
                    $sToken  = '';
                Severity: Minor
                Found in include/phpmailer/extras/htmlfilter.php - About 5 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_getnxtag has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function tln_getnxtag($body, $offset)
                {
                    if ($offset > mb_strlen($body)) {
                        return false;
                    }
                Severity: Major
                Found in include/phpmailer/extras/htmlfilter.php - About 5 hrs to fix

                  Method xnewsletter_emailSize has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function xnewsletter_emailSize($letter_id = 0)
                  {
                  //    require_once XNEWSLETTER_ROOT_PATH . '/class/class.xnewslettermailer.php';
                      global $XoopsTpl;
                      $helper = Xnewsletter\Helper::getInstance();
                  Severity: Major
                  Found in include/functions.php - About 5 hrs to fix

                    Method xnewsletter_printPage has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function xnewsletter_printPage($content)
                    {
                        global $xoopsConfig, $xoops_meta_keywords, $xoops_meta_description;
                        $myts = \MyTextSanitizer::getInstance(); ?>
                        <!DOCTYPE html>
                    Severity: Major
                    Found in print.php - About 5 hrs to fix

                      Function msgHTML has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function msgHTML($message, $basedir = '', $advanced = false)
                          {
                              preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
                              if (array_key_exists(2, $images)) {
                                  if (mb_strlen($basedir) > 1 && '/' != mb_substr($basedir, -1)) {
                      Severity: Minor
                      Found in include/phpmailer/class.phpmailer.php - About 5 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 subscribingMLHandler has 131 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function subscribingMLHandler($type, $subscr_id, $mailinglist_id)
                      {
                          global $xoopsUser, $xoopsConfig;
                          $helper = XoopsModules\Xnewsletter\Helper::getInstance();
                      
                      
                      Severity: Major
                      Found in include/mailinglist.php - About 5 hrs to fix

                        Function authenticate has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function authenticate(
                                $username,
                                $password,
                                $authtype = null,
                                $realm = '',
                        Severity: Minor
                        Found in include/phpmailer/class.smtp.php - About 5 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

                        SMTP has 38 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class SMTP
                        {
                            /**
                             * The PHPMailer SMTP version number.
                             * @var string
                        Severity: Minor
                        Found in include/phpmailer/class.smtp.php - About 5 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language