XoopsModules25x/apcal

View on GitHub

Showing 1,049 of 26,336 total issues

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

    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

      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 ($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 ($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

          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

                                  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 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 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

            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

              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 file_exists_ignoreopenbasedir has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function file_exists_ignoreopenbasedir($filename, $cached = true)
                    {
                        static $open_basedirs = null;
                        static $file_exists_cache = array();
                        if (!$cached || !isset($file_exists_cache[$filename])) {
                Severity: Minor
                Found in thumbs/phpthumb.class.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

                                                    switch ($secondbyte) {
                                                        case 0:
                                                            // end of line
                                                            // no need for special processing, just ignore
                                                            break;
                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++) {
                                                      $paletteindex                     = ord($BMPpixelData{$pixeldataoffset++});
                                                      $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
                                                  }
                  Severity: Major
                  Found in thumbs/phpthumb.bmp.php - About 45 mins to fix

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

                        public function ImageMagickWhichConvert()
                        {
                            static $WhichConvert = null;
                            if (is_null($WhichConvert)) {
                                if ($this->iswindows) {
                    Severity: Minor
                    Found in thumbs/phpthumb.class.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

                                                    for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
                                                        $pixelvalue      = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset, $thisfile_bmp_header_raw['bits_per_pixel'] / 8));
                                                        $pixeldataoffset += $thisfile_bmp_header_raw['bits_per_pixel'] / 8;
                    
                                                        $red                              = (int)round(((($pixelvalue & $thisfile_bmp_header_raw['red_mask']) >> $redshift) / ($thisfile_bmp_header_raw['red_mask']
                    Severity: Major
                    Found in thumbs/phpthumb.bmp.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                              if (!phpthumb_functions::IsHexColor($color)) {
                                                                  $color = ((!empty($this->bc)
                                                                             && phpthumb_functions::IsHexColor($this->bc)) ? $this->bc : '000000');
                                                              }
                      Severity: Major
                      Found in thumbs/phpthumb.class.php - About 45 mins to fix

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

                            public function GenerateThumbnail()
                            {
                                $this->setOutputFormat();
                                $this->phpThumbDebug('8a');
                                $this->ResolveSource();
                        Severity: Minor
                        Found in thumbs/phpthumb.class.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 (strlen($imgdata) <= $this->maxb) {
                                                        break;
                                                    }
                        Severity: Major
                        Found in thumbs/phpthumb.class.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

                          Severity
                          Category
                          Status
                          Source
                          Language