XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

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

        public static function URLreadFsock($host, $file, &$errstr, $successonly = true, $port = 80, $timeout = 10)
    Severity: Minor
    Found in thumbs/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 thumbs/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 thumbs/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 thumbs/phpthumb.filters.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 thumbs/phpthumb.functions.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

                      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 ($imagetypes & IMG_WBMP) {
                                                $gd_info['WBMP Support'] = true;
                                            }
                        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_JPG) {
                                                  $gd_info['JPG 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

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                      isHsAnchor: function (a) {
                                          return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
                                      },
                              Severity: Major
                              Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 45 mins to fix
                              assets/images/js/highslide/highslide-with-gallery.js on lines 561..563
                              assets/images/js/highslide/highslide-with-html.js on lines 536..538
                              assets/images/js/highslide/highslide.js on lines 397..399

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 50.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                      isHsAnchor: function (a) {
                                          return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
                                      },
                              Severity: Major
                              Found in assets/images/js/highslide/highslide.js and 3 other locations - About 45 mins to fix
                              assets/images/js/highslide/highslide-full.js on lines 705..707
                              assets/images/js/highslide/highslide-with-gallery.js on lines 561..563
                              assets/images/js/highslide/highslide-with-html.js on lines 536..538

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 50.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                      isHsAnchor: function (a) {
                                          return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
                                      },
                              Severity: Major
                              Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 45 mins to fix
                              assets/images/js/highslide/highslide-full.js on lines 705..707
                              assets/images/js/highslide/highslide-with-html.js on lines 536..538
                              assets/images/js/highslide/highslide.js on lines 397..399

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 50.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                      isHsAnchor: function (a) {
                                          return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
                                      },
                              Severity: Major
                              Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 45 mins to fix
                              assets/images/js/highslide/highslide-full.js on lines 705..707
                              assets/images/js/highslide/highslide-with-gallery.js on lines 561..563
                              assets/images/js/highslide/highslide.js on lines 397..399

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 50.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 4 locations. Consider refactoring.
                              Open

                                  hs.addEventListener(document, 'mousemove', function (e) {
                                      hs.mouse = {x: e.clientX, y: e.clientY};
                                  });
                              Severity: Major
                              Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 40 mins to fix
                              assets/images/js/highslide/highslide-full.js on lines 3396..3398
                              assets/images/js/highslide/highslide-with-html.js on lines 2541..2543
                              assets/images/js/highslide/highslide.js on lines 1913..1915

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 49.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Severity
                              Category
                              Status
                              Source
                              Language