XoopsModules25x/xoopspoll

View on GitHub

Showing 181 of 2,846 total issues

Function parseTime has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.datepicker.parseTime = function (timeFormat, timeString, options) {
        var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),
            iso8601 = (timeFormat.replace(/\'.*?\'/g, '').indexOf('Z') !== -1);

        // Strict parse requires the timeString to match the timeFormat exactly
Severity: Major
Found in assets/js/jquery-ui-timepicker-addon.js - About 5 hrs to fix

    Function insert has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

        public function insert(\XoopsObject $post, $force = true)
        {
            // Set the post time
            // The time should be 'publish' time. To be adjusted later
            if (!$post->getVar('post_time')) {
    Severity: Minor
    Found in extras/newbb_5x/irmtfan/class/PostHandler.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

    Function insert has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

        public function insert(\XoopsObject $post, $force = true)
        {
            global $xoopsUser;
    
            // Set the post time
    Severity: Minor
    Found in extras/newbb_5x/trunk_5_00/class/Post.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 main.php has 396 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/trunk_5_00/language/main.php - About 5 hrs to fix

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

          public function showPost($isadmin)
          {
              global $xoopsConfig, $xoopsModule, $xoopsUser, $myts;
              /** @var Xoopspoll\Helper $helper */
              $helper = Xoopspoll\Helper::getInstance();
      Severity: Minor
      Found in extras/newbb_5x/trunk_5_00/class/Post.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 showPost has 124 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function showPost($isadmin)
          {
              global $xoopsConfig, $xoopsModule, $xoopsUser, $myts;
              /** @var Xoopspoll\Helper $helper */
              $helper = Xoopspoll\Helper::getInstance();
      Severity: Major
      Found in extras/newbb_5x/trunk_5_00/class/Post.php - About 4 hrs to fix

        Function _newInst has 123 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _newInst: function ($input, opts) {
                    var tp_inst = new Timepicker(),
                        inlineSettings = {},
                        fns = {},
                        overrides, i;
        Severity: Major
        Found in assets/js/jquery-ui-timepicker-addon.js - About 4 hrs to fix

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

          function xoopspollBlockMultiShow(array $options): array
          {
              $block           = [];
              $pollOptionArray = [];
              /** @var \XoopsModuleHandler $moduleHandler */
          Severity: Minor
          Found in blocks/multipoll.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 listBlocks has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
          Open

              public function listBlocks(): void
              {
                  $pathIcon16 = Admin::iconUrl('', '16');
          
                  require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
          Severity: Minor
          Found in class/Common/Blocksadmin.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 xoopspollBlockSinglepollShow has 114 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function xoopspollBlockSinglepollShow(mixed $options): array
          {
              $block = [];
          
              /** @var \XoopsConfigHandler $configHandler */
          Severity: Major
          Found in blocks/singlepoll.php - About 4 hrs to fix

            Method xoopspollBlockMultiShow has 114 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function xoopspollBlockMultiShow(array $options): array
            {
                $block           = [];
                $pollOptionArray = [];
                /** @var \XoopsModuleHandler $moduleHandler */
            Severity: Major
            Found in blocks/multipoll.php - About 4 hrs to fix

              Function strictParse has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      var strictParse = function (f, s, o) {
              
                          // pattern for standard and localized AM/PM markers
                          var getPatternAmpm = function (amNames, pmNames) {
                              var markers = [];
              Severity: Major
              Found in assets/js/jquery-ui-timepicker-addon.js - About 4 hrs to fix

                Method _delete has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function _delete($post, $force = false)
                    {
                        if ((!$post instanceof Post) || (0 === $post->getVar('post_id'))) {
                            return false;
                        }
                Severity: Major
                Found in extras/newbb_5x/irmtfan/class/PostHandler.php - About 4 hrs to fix

                  Method xoopspollBlockSinglepollEdit has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function xoopspollBlockSinglepollEdit(mixed $options): string
                  {
                      /**
                       * Options[]
                       *            0 = show expired polls in block
                  Severity: Major
                  Found in blocks/singlepoll.php - About 4 hrs to fix

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

                        public function render(): string
                        {
                            static $included = false;
                    
                            $ele_name  = $this->getName();
                    Severity: Major
                    Found in class/FormDateTimePicker.php - About 4 hrs to fix

                      File Poll.php has 343 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php declare(strict_types=1);
                      
                      namespace XoopsModules\Xoopspoll;
                      
                      /*
                      Severity: Minor
                      Found in class/Poll.php - About 4 hrs to fix

                        Function _onTimeChange has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                _onTimeChange: function () {
                                    if (!this._defaults.showTimepicker) {
                                                        return;
                                    }
                                    var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
                        Severity: Major
                        Found in assets/js/jquery-ui-timepicker-addon.js - About 4 hrs to fix

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

                              public function render(?array $block = null): void
                              {
                                  \xoops_load('XoopsFormLoader');
                                  \xoops_loadLanguage('common', $this->moduleDirNameUpper);
                          
                          
                          Severity: Major
                          Found in class/Common/Blocksadmin.php - About 3 hrs to fix

                            Function xoopspollBlockSinglepollEdit has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function xoopspollBlockSinglepollEdit(mixed $options): string
                            {
                                /**
                                 * Options[]
                                 *            0 = show expired polls in block
                            Severity: Minor
                            Found in blocks/singlepoll.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

                            Method insert has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function insert(\XoopsObject $post, $force = true)
                                {
                                    // Set the post time
                                    // The time should be 'publish' time. To be adjusted later
                                    if (!$post->getVar('post_time')) {
                            Severity: Major
                            Found in extras/newbb_5x/irmtfan/class/PostHandler.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language