XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Avoid deeply nested control flow statements.
Open

                            for ($k = 0, $kMax = count($unused); $k <= $kMax; ++$k) {
                                {
                                    echo "               <tr>\n";
                                    echo '                   <td class="text">' . $unused[$k] . "</td>\n";
                                    echo "               </tr>\n";
Severity: Major
Found in include/patTemplate.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF
                            && $config->getVar('conf_name') === 'language'
                        ) {
                            // regenerate admin menu file
                            $xoopsConfig['language'] = $_POST[$config->getVar('conf_name')];
    Severity: Major
    Found in include/preferences.inc.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if ($event->start + $tzoffset >= $now_unixtime + 86400
                                      || $event->end + $tzoffset <= $now_unixtime
                                  ) {
                                      continue;
                                  }
      Severity: Major
      Found in class/APCal.php - About 45 mins to fix

        Function get_daytype has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                public function get_daytype($date)
                {
                    preg_match("/^([0-9][0-9]+)[-.\/]?([0-1]?[0-9])[-.\/]?([0-3]?[0-9])$/", $date, $regs);
                    $year  = (int)$regs[1];
                    $month = (int)$regs[2];
        Severity: Minor
        Found in class/APCal.php - About 45 mins 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 apcal_after_schedule_show_tpl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            function apcal_after_schedule_show_tpl($options)
            {
                global $xoopsConfig, $xoopsDB;
        
                $moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];
        Severity: Minor
        Found in blocks/apcal_after_schedule.php - About 45 mins 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 recurseCopy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function recurseCopy($src, $dst)
            {
                $dir = opendir($src);
                //    @mkdir($dst);
                while (false !== ($file = readdir($dir))) {
        Severity: Minor
        Found in class/utility.php - About 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                                if ($event->gmlat > 0 || $event->gmlong > 0) {
                                    $this->gmPoints[$event->id] = array(
                                        'summary'   => $event->summary,
                                        'gmlat'     => $event->gmlat,
                                        'gmlong'    => $event->gmlong,
        Severity: Major
        Found in class/APCal.php - About 45 mins to fix

          Function get_categories_selform has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

                  public function get_categories_selform($get_target = '', $smode = null)
                  {
                      global $xoopsModule;
          
                      if (empty($this->categories)) {
          Severity: Minor
          Found in class/APCal.php - About 45 mins 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 apcal_search_base has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function apcal_search_base($moduleDirName, $keywords, $andor, $limit, $offset, $uid)
          Severity: Minor
          Found in include/search.inc.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (!$ok) {
                                        ++$i;
                                    }
            Severity: Major
            Found in class/APCal.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for ($d = $startDay; $d <= $endDay; ++$d) {
                                          if (isset($eventsids[$d][$i])) {
                                              $ok = false;
                                          }
                                      }
              Severity: Major
              Found in class/APCal.php - About 45 mins to fix

                Function deInterlace has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function deInterlace()
                    {
                        $data = $this->m_data;
                
                        for ($i = 0; $i < 4; $i++) {
                Severity: Minor
                Found in thumbs/phpthumb.gif.php - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                        if ($event->extkey0 == 1) {
                                            $event_str .= "&nbsp;&nbsp;<img src='{$roimage}' height='15px' alt='" . _APCAL_RO_ONLINE_POSS . "' title='" . _APCAL_RO_ONLINE_POSS . "' />";
                                        } // added by goffy: mark this event, that online registration is active
                Severity: Major
                Found in class/APCal.php - About 45 mins to fix

                  Function apcal_map_show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function apcal_map_show($options)
                      {
                          global $xoopsConfig, $xoopsDB;
                  
                          $original_level = error_reporting(E_ALL ^ E_NOTICE);
                  Severity: Minor
                  Found in blocks/apcal_map.php - About 45 mins 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

                  Avoid deeply nested control flow statements.
                  Open

                                      if ($expire > time() && $prev_uid == $uid) {
                                          $block = unserialize($cache_bodies[2]);
                                          if ($robots_mode) {
                                              $block['root_url'] = $block['mod_url'] . '/';
                                              // $block['php_self'] = '/' ;
                  Severity: Major
                  Found in blocks/apcal_minical_ex.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if ($event->start + $tzoffset >= $bottomtime_of_day
                                                    || $event->start + $tzoffset != $toptime_of_day
                                                       && $event->end + $tzoffset <= $toptime_of_day
                                                ) {
                                                    continue;
                    Severity: Major
                    Found in class/APCal.php - About 45 mins to fix

                      Function apcal_thedays_schedule_show_tpl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function apcal_thedays_schedule_show_tpl($options)
                          {
                              global $xoopsConfig, $xoopsDB;
                      
                              $moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];
                      Severity: Minor
                      Found in blocks/apcal_thedays_schedule.php - About 45 mins 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

                      Avoid deeply nested control flow statements.
                      Open

                                              if ($mode === 'NO_YEAR' && ($gmlat > 0 || $gmlong > 0)) {
                                                  $this->gmPoints[] = array(
                                                      'summary'   => $title,
                                                      'gmlat'     => $gmlat,
                                                      'gmlong'    => $gmlong,
                      Severity: Major
                      Found in class/APCal.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
                                                            $thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData{$pixeldataoffset + 2}) << 16)
                                                                                                | (ord($BMPpixelData{$pixeldataoffset + 1}) << 8)
                                                                                                | ord($BMPpixelData{$pixeldataoffset});
                                                            $pixeldataoffset                  += 3;
                        Severity: Major
                        Found in thumbs/phpthumb.bmp.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) {
                                                              $paletteindexbyte = ord($BMPpixelData{$pixeldataoffset++});
                                                              for ($i = 7; $i >= 0; $i--) {
                                                                  $paletteindex                     = ($paletteindexbyte & (0x01 << $i)) >> $i;
                                                                  $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
                          Severity: Major
                          Found in thumbs/phpthumb.bmp.php - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language