modxcms/revolution

View on GitHub

Showing 7,873 of 7,873 total issues

Avoid deeply nested control flow statements.
Open

                                    for ($i = 0; $i < $firstbyte; $i++) {
                                        $col = $pixelcounter % $thisfile_bmp_header_raw['width'];
                                        $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']);
                                        $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$secondbyte];
                                        $pixelcounter++;
Severity: Major
Found in core/model/phpthumb/phpthumb.bmp.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                    while (($pixeldataoffset % 4) != 0) {
                                        // lines are padded to nearest DWORD
                                        $pixeldataoffset++;
                                    }
    Severity: Major
    Found in core/model/phpthumb/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++) {
                                          $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']   >> $redshift))   * 255);
      Severity: Major
      Found in core/model/phpthumb/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 = 1; $i >= 0; $i--) {
                                                $paletteindex = ($paletteindexbyte & (0x0F << (4 * $i))) >> (4 * $i);
                                                $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
        Severity: Major
        Found in core/model/phpthumb/phpthumb.bmp.php - About 45 mins to fix

          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 core/model/phpthumb/phpthumb.bmp.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                            while (($pixeldataoffset % 4) != 0) {
                                                // lines are padded to nearest DWORD
                                                $pixeldataoffset++;
                                            }
            Severity: Major
            Found in core/model/phpthumb/phpthumb.bmp.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (strlen($imgdata) <= $this->maxb) {
                                              imagetruecolortopalette($this->gdimg_output, true, pow(2, $i));
                                              break;
                                          }
              Severity: Major
              Found in core/model/phpthumb/phpthumb.class.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if ($imagetypes & IMG_PNG) {
                                        $gd_info['PNG Support'] = true;
                                    }
                Severity: Major
                Found in core/model/phpthumb/phpthumb.functions.php - About 45 mins to fix

                  Method URLreadFsock has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static function URLreadFsock($host, $file, &$errstr, $successonly=true, $port=-1, $timeout=10) {
                  Severity: Minor
                  Found in core/model/phpthumb/phpthumb.functions.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if ($imagetypes & IMG_JPG) {
                                            $gd_info['JPG Support'] = true;
                                        }
                    Severity: Major
                    Found in core/model/phpthumb/phpthumb.functions.php - About 45 mins to fix

                      Method Frame has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function Frame(&$gdimg, $frame_width, $edge_width, $hexcolor_frame, $hexcolor1, $hexcolor2) {
                      Severity: Minor
                      Found in core/model/phpthumb/phpthumb.filters.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if ($imagetypes & IMG_GIF) {
                                                $gd_info['GIF Create Support'] = true;
                                            }
                        Severity: Major
                        Found in core/model/phpthumb/phpthumb.functions.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          for ($y = $watermark_margin_y; $y < ($img_source_height + $watermark_source_height); $y += ($watermark_source_height + $watermark_margin_y)) {
                                                              imagecopy(
                                                                  $gdimg_tiledwatermark,
                                                                  $img_watermark,
                                                                  $x,
                          Severity: Major
                          Found in core/model/phpthumb/phpthumb.filters.php - About 45 mins to fix

                            Method WatermarkOverlay has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function WatermarkOverlay(&$gdimg_dest, &$img_watermark, $alignment='*', $opacity=50, $margin_x=5, $margin_y=null) {
                            Severity: Minor
                            Found in core/model/phpthumb/phpthumb.filters.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if (!isset($PixelMap[$x][$y]['alpha']) || ($PixelMap[$x][$y]['alpha'] > 0)) {
                                                          if (isset($PixelMap[$x + (int)$Offset['x']][$y + (int)$Offset['y']]['alpha']) && ($PixelMap[$x + (int)$Offset['x']][$y + (int)$Offset['y']]['alpha'] < 127)) {
                                                              $thisColor = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor, false, $PixelMap[$x + (int)$Offset['x']][$y + (int)$Offset['y']]['alpha']);
                                                              imagesetpixel($gdimg_dropshadow_temp, $x, $y, $thisColor);
                                                          }
                              Severity: Major
                              Found in core/model/phpthumb/phpthumb.filters.php - About 45 mins to fix

                                Method ScaleToFitInBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public static function ScaleToFitInBox($width, $height, $maxwidth=null, $maxheight=null, $allow_enlarge=true, $allow_reduce=true) {
                                Severity: Minor
                                Found in core/model/phpthumb/phpthumb.functions.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if ($imagetypes & IMG_WBMP) {
                                                          $gd_info['WBMP Support'] = true;
                                                      }
                                  Severity: Major
                                  Found in core/model/phpthumb/phpthumb.functions.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if ($tempfilename = phpthumb::phpThumb_tempnam()) {
                                                            if ($fp_tempfile = @fopen($tempfilename, 'wb')) {
                                                                fwrite($fp_tempfile, base64_decode('R0lGODlhAQABAIAAAH//AP///ywAAAAAAQABAAACAUQAOw==')); // very simple 1px GIF file base64-encoded as string
                                                                fclose($fp_tempfile);
                                                                $phpthumb_temp = new phpthumb();
                                    Severity: Major
                                    Found in core/model/phpthumb/phpthumb.functions.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              switch ($errno) {
                                                                  case 200:
                                                                      // great, continue
                                                                      break;
                                      
                                      
                                      Severity: Major
                                      Found in core/model/phpthumb/phpthumb.functions.php - About 45 mins to fix

                                        Method DropShadow has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            public function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $alpha) {
                                        Severity: Minor
                                        Found in core/model/phpthumb/phpthumb.filters.php - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language