XoopsModules25x/xoopspoll

View on GitHub

Showing 181 of 2,846 total issues

File jquery-ui-timepicker-addon.js has 1782 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
(function (factory) {
    if (typeof define === 'function' && define.amd) {
Severity: Major
Found in assets/js/jquery-ui-timepicker-addon.js - About 4 days to fix

    File Post.php has 800 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    
    /**
     * Newbb module
     *
    Severity: Major
    Found in extras/newbb_5x/trunk_5_00/class/Post.php - About 1 day to fix

      File viewtopic.php has 660 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php declare(strict_types=1);
      /*------------------------------------------------------------------------
                      XOOPS - PHP Content Management System
                          Copyright (c) 2000-2020 XOOPS.org
                             <https://xoops.org>
      Severity: Major
      Found in extras/newbb_5x/irmtfan/viewtopic.php - About 1 day to fix

        Function _delete has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _delete($post, $force = false)
            {
                if ((!$post instanceof Post) || (0 === $post->getVar('post_id'))) {
                    return false;
                }
        Severity: Minor
        Found in extras/newbb_5x/irmtfan/class/PostHandler.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 main.php has 591 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php declare(strict_types=1);
        /*
                       XOOPS - PHP Content Management System
                           Copyright (c) 2000-2020 XOOPS.org
                              <https://xoops.org>
        Severity: Major
        Found in admin/main.php - About 1 day to fix

          File viewtopic.php has 587 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php declare(strict_types=1);
          
          /**
           * Newbb module
           *
          Severity: Major
          Found in extras/newbb_5x/trunk_5_00/viewtopic.php - About 1 day to fix

            File Blocksadmin.php has 554 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php declare(strict_types=1);
            
            namespace XoopsModules\Xoopspoll\Common;
            
            /**
            Severity: Major
            Found in class/Common/Blocksadmin.php - About 1 day to fix

              File Post.php has 528 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php declare(strict_types=1);
              
              namespace XoopsModules\Newbb;
              
              /*
              Severity: Major
              Found in extras/newbb_5x/irmtfan/class/Post.php - About 1 day to fix

                Function _delete has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function _delete($post, $force = false)
                    {
                        global $xoopsModule;
                
                        if (!is_object($post) || 0 == $post->getVar('post_id')) {
                Severity: Minor
                Found in extras/newbb_5x/trunk_5_00/class/Post.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

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

                    public static function truncateHtml(
                        string $text,
                        ?int $length = 100,
                        ?string $ending = '...',
                        ?bool $exact = false,
                Severity: Minor
                Found in class/Common/SysUtility.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

                Method showPost has 201 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function showPost($isadmin)
                    {
                        global $myts;
                        global $forumUrl, $forumImage;
                        global $viewtopic_users, $viewtopic_posters, $forum_obj, $topic_obj, $online, $user_karma, $viewmode, $order, $start, $total_posts, $topic_status;
                Severity: Major
                Found in extras/newbb_5x/irmtfan/class/Post.php - About 1 day to fix

                  File polls.php has 495 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php declare(strict_types=1);
                  /*
                   * Newbb module
                   *
                   * You may not change or alter any portion of this comment or credits
                  Severity: Minor
                  Found in extras/newbb_5x/irmtfan/polls.php - About 7 hrs to fix

                    File main.php has 480 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php declare(strict_types=1);
                    
                    if (defined('MAIN_DEFINED')) {
                        return;
                    }
                    Severity: Minor
                    Found in extras/newbb_5x/irmtfan/language/english/main.php - About 7 hrs to fix

                      Function xoops_module_update_xoopspoll has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function xoops_module_update_xoopspoll(\XoopsModule $module, $prev_version): bool
                      {
                          // referer check
                          $success = false;
                          $ref     = xoops_getenv('HTTP_REFERER');
                      Severity: Minor
                      Found in include/onupdate.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 _limitMinMaxDateTime has 174 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              _limitMinMaxDateTime: function (dp_inst, adjustSliders) {
                                  var o = this._defaults,
                                      dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
                      
                                  if (!this._defaults.showTimepicker) {
                      Severity: Major
                      Found in assets/js/jquery-ui-timepicker-addon.js - About 6 hrs to fix

                        Function xoopspollBlockSinglepollShow has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function xoopspollBlockSinglepollShow(mixed $options): array
                        {
                            $block = [];
                        
                            /** @var \XoopsConfigHandler $configHandler */
                        Severity: Minor
                        Found in blocks/singlepoll.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

                        Function _injectTimePicker has 165 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                _injectTimePicker: function () {
                                    var $dp = this.inst.dpDiv,
                                        o = this.inst.settings,
                                        tp_inst = this,
                                        litem = '',
                        Severity: Major
                        Found in assets/js/jquery-ui-timepicker-addon.js - About 6 hrs to fix

                          Function showPost has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function showPost($isadmin)
                              {
                                  global $myts;
                                  global $forumUrl, $forumImage;
                                  global $viewtopic_users, $viewtopic_posters, $forum_obj, $topic_obj, $online, $user_karma, $viewmode, $order, $start, $total_posts, $topic_status;
                          Severity: Minor
                          Found in extras/newbb_5x/irmtfan/class/Post.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 listBlocks has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function listBlocks(): void
                              {
                                  $pathIcon16 = Admin::iconUrl('', '16');
                          
                                  require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                          Severity: Major
                          Found in class/Common/Blocksadmin.php - About 6 hrs to fix

                            File PostHandler.php has 417 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php declare(strict_types=1);
                            
                            namespace XoopsModules\Newbb;
                            
                            /*
                            Severity: Minor
                            Found in extras/newbb_5x/irmtfan/class/PostHandler.php - About 6 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language