mambax7/xnewsletter

View on GitHub

Showing 283 of 379 total issues

File class.phpmailer-bmh.php has 374 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/* class.phpmailer-bmh.php
.---------------------------------------------------------------------------.
|  Software: PHPMailer-BMH (Bounce Mail Handler)                            |
|   Version: 5.0.0rc1                                                       |
Severity: Minor
Found in include/phpmailer_bmh/class.phpmailer-bmh.php - About 5 hrs to fix

    File import.php has 373 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/import.php - About 4 hrs to fix

      Function subscribingMLHandler has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      function subscribingMLHandler($type, $subscr_id, $mailinglist_id)
      {
          global $xoopsUser, $xoopsConfig;
          $helper = XoopsModules\Xnewsletter\Helper::getInstance();
      
      
      Severity: Minor
      Found in include/mailinglist.php - About 4 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 xnewsletter_plugin_getdata_csv has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

      function xnewsletter_plugin_getdata_csv(
          $cat_id,
          $action_after_read,
          $limitCheck,
          $skipCatsubscrExist,
      Severity: Minor
      Found in plugins/csv.php - About 4 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 createBody has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createBody()
          {
              $body = '';
              //Create unique IDs and preset boundaries
              $this->uniqueid    = $this->generateId();
      Severity: Minor
      Found in include/phpmailer/class.phpmailer.php - About 4 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 118 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getForm($action = false)
          {
              global $xoopsDB;
      
              /** @var \XoopsGroupPermHandler $grouppermHandler */
      Severity: Major
      Found in class/Cat.php - About 4 hrs to fix

        File letter.php has 360 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/letter.php - About 4 hrs to fix

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

              public function getForm($action = false)
              {
                  global $xoopsDB;
          
                  if (false === $action) {
          Severity: Major
          Found in class/Accounts.php - About 4 hrs to fix

            Function xnewsletter_emailSize has a Cognitive Complexity of 31 (exceeds 5 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: Minor
            Found in include/functions.php - About 4 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 processMailbox has 114 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function processMailbox($max = false)
                {
                    if (empty($this->action_function) || !function_exists($this->action_function)) {
                        $this->error_msg = 'Action function not found!';
                        $this->output();
            Severity: Major
            Found in include/phpmailer_bmh/class.phpmailer-bmh.php - About 4 hrs to fix

              Method _mime_types has 104 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function _mime_types($ext = '')
                  {
                      $mimes = [
                          'xl'    => 'application/excel',
                          'js'    => 'application/javascript',
              Severity: Major
              Found in include/phpmailer/class.phpmailer.php - About 4 hrs to fix

                Function createHeader has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function createHeader()
                    {
                        $result = '';
                
                        $result .= $this->headerLine('Date', '' == $this->MessageDate ? self::rfcDate() : $this->MessageDate);
                Severity: Minor
                Found in include/phpmailer/class.phpmailer.php - About 3 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 xnewsletter_getUserPermissionsByLetter has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                function xnewsletter_getUserPermissionsByLetter($letter_id = 0)
                {
                    global $xoopsUser;
                    /** @var \XoopsGroupPermHandler $grouppermHandler */
                    $grouppermHandler = xoops_getHandler('groupperm');
                Severity: Minor
                Found in include/functions.php - About 3 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 class.html2text.php has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*************************************************************************
                 *                                                                       *
                 * Converts HTML to formatted plain text                                 *
                 *                                                                       *
                Severity: Minor
                Found in include/phpmailer/extras/class.html2text.php - About 3 hrs to fix

                  Method tln_sanitize has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function tln_sanitize(
                      $body,
                      $tag_list,
                      $rm_tags_with_content,
                      $self_closing_tags,
                  Severity: Major
                  Found in include/phpmailer/extras/htmlfilter.php - About 3 hrs to fix

                    Method xoops_module_update_xnewsletter_130 has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function xoops_module_update_xnewsletter_130()
                    {
                        // change module dirname to lowercase
                        $path    = dirname(__DIR__);
                        $dirname = basename(dirname(__DIR__));
                    Severity: Major
                    Found in include/onupdate.php - About 3 hrs to fix

                      Method HTMLFilter has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function HTMLFilter($body, $trans_image_path, $block_external_images = false)
                      {
                          $tag_list = [
                              false,
                              'object',
                      Severity: Major
                      Found in include/phpmailer/extras/htmlfilter.php - About 3 hrs to fix

                        Method processBounce has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function processBounce($pos, $type, $totalFetched)
                            {
                                $header  = imap_headerinfo($this->_mailbox_link, $pos);
                                $subject = strip_tags($header->subject);
                                if ('DSN' === $type) {
                        Severity: Major
                        Found in include/phpmailer_bmh/class.phpmailer-bmh.php - About 3 hrs to fix

                          Method xnewsletter_createTasks has 96 lines of code (exceeds 25 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: Major
                          Found in include/task.inc.php - About 3 hrs to fix

                            Method tln_fixstyle has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
                            {
                                // workaround for </style> in between comments
                                $content = '';
                                $sToken  = '';
                            Severity: Major
                            Found in include/phpmailer/extras/htmlfilter.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language