XoopsModules25x/apcal

View on GitHub

Showing 1,049 of 26,336 total issues

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

        &$gdimg_dest,
        &$img_watermark,
        $alignment = '*',
        $opacity = 50,
        $margin_x = 5,
Severity: Minor
Found in thumbs/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 + $Offset['x']][$y + $Offset['y']]['alpha'])
                                    && ($PixelMap[$x + $Offset['x']][$y + $Offset['y']]['alpha'] < 127)
                                ) {
                                    $thisColor = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor, false, $PixelMap[$x + $Offset['x']][$y + $Offset['y']]['alpha']);
    Severity: Major
    Found in thumbs/phpthumb.filters.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, $y, 0, 0, min($watermark_source_width, $img_source_width - $x - $watermark_margin_x),
                                                    min($watermark_source_height, $img_source_height - $y - $watermark_margin_y));
                                      }
      Severity: Major
      Found in thumbs/phpthumb.filters.php - About 45 mins to fix

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

                $width,
                $height,
                $maxwidth = null,
                $maxheight = null,
                $allow_enlarge = true,
        Severity: Minor
        Found in thumbs/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);
          
          
          Severity: Major
          Found in thumbs/phpthumb.functions.php - About 45 mins to fix

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

                public function HistogramAnalysis(&$gdimg, $calculateGray = false)
                {
                    $ImageSX = imagesx($gdimg);
                    $ImageSY = imagesy($gdimg);
                    for ($x = 0; $x < $ImageSX; $x++) {
            Severity: Minor
            Found in thumbs/phpthumb.filters.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 ($imagetypes & IMG_PNG) {
                                    $gd_info['PNG Support'] = true;
                                }
            Severity: Major
            Found in thumbs/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 thumbs/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 thumbs/phpthumb.functions.php - About 45 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (ev.ctrlKey) {
                          switch (K) {
                              case 37: // KEY left
                                  act && Calendar.cellClick(cal._nav_pm);
                                  break;
                  Severity: Major
                  Found in assets/js/jscalendar/calendar.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                                    if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                                        || (sg && sg === this.slideshowGroup)) {
                                        if (this.isImage || (this.isHtml && o.useOnHtml))
                                            this.createOverlay(o);
                                    }
                    Severity: Major
                    Found in assets/images/js/highslide/highslide-full.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                      if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                                          || (sg && sg === this.slideshowGroup)) {
                                          this.createOverlay(o);
                                      }
                      Severity: Major
                      Found in assets/images/js/highslide/highslide-with-gallery.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                        if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                                            || (sg && sg === this.slideshowGroup)) {
                                            this.createOverlay(o);
                                        }
                        Severity: Major
                        Found in assets/images/js/highslide/highslide.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                                              || (sg && sg === this.slideshowGroup)) {
                                              if (this.isImage || (this.isHtml && o.useOnHtml))
                                                  this.createOverlay(o);
                                          }
                          Severity: Major
                          Found in assets/images/js/highslide/highslide-with-html.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                            if (!empty($_POST['fct']) && !empty($_POST['op']) && !empty($_POST['diranme']) && $_POST['fct'] === 'modulesadmin'
                                && $_POST['op'] === 'update_ok'
                                && $_POST['dirname'] == $modversion['dirname']
                            ) {
                                include __DIR__ . '/include/onupdate.inc.php';
                            Severity: Major
                            Found in xoops_version.php - About 40 mins to fix

                              Function deletePic has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              function deletePic(url, p, e, m, n) {
                              Severity: Minor
                              Found in ajax/pictures.js - About 35 mins to fix

                                Function setPosition has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        setPosition: function (pos, offset, vis, dur, easing) {
                                Severity: Minor
                                Found in assets/images/js/highslide/highslide-full.js - About 35 mins to fix

                                  Function createElement has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          createElement: function (tag, attribs, styles, parent, nopad) {
                                  Severity: Minor
                                  Found in assets/images/js/highslide/highslide-full.js - About 35 mins to fix

                                    Function createElement has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            createElement: function (tag, attribs, styles, parent, nopad) {
                                    Severity: Minor
                                    Found in assets/images/js/highslide/highslide.js - About 35 mins to fix

                                      Function setPosition has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              setPosition: function (pos, offset, vis, dur, easing) {
                                      Severity: Minor
                                      Found in assets/images/js/highslide/highslide.js - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language