mambax7/pedigree

View on GitHub

Showing 702 of 1,100 total issues

Function Crop has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function Crop(&$gdimg, $left = 0, $right = 0, $top = 0, $bottom = 0)
    {
        if (!$left && !$right && !$top && !$bottom) {
            return true;
        }
Severity: Minor
Found in phpthumb/phpthumb.filters.php - About 55 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 filedate_remote has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function filedate_remote($remotefile, $timeout = 10)
    {
        $date       = false;
        $parsed_url = self::ParseURLbetter($remotefile);
        if ($fp = @fsockopen($parsed_url['host'], $parsed_url['port'], $errno, $errstr, $timeout)) {
Severity: Minor
Found in phpthumb/phpthumb.functions.php - About 55 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 phpThumbURL has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function phpThumbURL($ParameterString, $path_to_phpThumb = 'phpThumb.php')
{
    global $PHPTHUMB_CONFIG;
    if (is_array($ParameterString)) {
        $ParameterStringArray = $ParameterString;
Severity: Minor
Found in phpthumb/phpThumb.config.php - About 55 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 isBlockCloned has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
Severity: Major
Found in admin/blocksadmin.php - About 50 mins to fix

    Method MakePie has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $filename,
            $pieWidth,
            $pieHeight,
            $ShadowDistance,
            $pieBackgroundColor,
    Severity: Major
    Found in class/eq_pie.php - About 50 mins to fix

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

          function setOrder($bid, $title, $weight, $visible, $side, $bcachetime)
      Severity: Minor
      Found in admin/blocksadmin.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (n <= 14) {
                                r = 255 - (n * 17);
                                g = b = 0;
                            } else if (n > 14 && n <= 28) {
                                g = 255 - ((n - 14) * 17);
        Severity: Major
        Found in assets/js/picker.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if(el.is('img')) {
                                      el.attr('src', value);
                                  } else {
                                      el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
                                  }
          Severity: Major
          Found in assets/js/jquery.magnific-popup.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (base.authority !== null && base.path === '') {
                                            t.path = '/' + r.path;
                                        } else {
                                            t.path = base.path.replace(/[^\/]+$/, '') + r.path;
                                        }
            Severity: Major
            Found in assets/js/jscolor/jscolor.js - About 45 mins to fix

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

                  getViewSize: function () {
                      if (typeof window.innerWidth === 'number') {
                          return [window.innerWidth, window.innerHeight];
                      } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                          return [document.body.clientWidth, document.body.clientHeight];
              Severity: Minor
              Found in assets/js/jscolor/jscolor.js - 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 hsv2hex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function hsv2hex($h, $s, $v)
                  {
                      $s /= 256.0;
                      $v /= 256.0;
                      if (0.0 == $s) {
              Severity: Minor
              Found in class/ImageColor.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 getFollowingStep has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getFollowingStep($step)
                  {
                      $ret   = null;
                      $steps = \array_keys($this->_steps);
              
              
              Severity: Minor
              Found in class/ZervWizard.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 getFileStatus has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
                  {
                      global $pathIcon16;
              
                      if (empty($file_path)) {
              Severity: Minor
              Found in class/Common/FileChecker.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 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 0old/phpthumb/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

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

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

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

                  public static function lettersChoice($myObject, $activeObject, $criteria, $name, $link, $link2 = null)
              Severity: Minor
              Found in class/Utility.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                        if (preg_match('# \\-crop "([0-9]+)x([0-9]+)\\+0\\+0" #', $commandline, $matches)) {
                                                            $commandline = str_replace(' -crop "' . $matches[1] . 'x' . $matches[2] . '+0+0" ', ' -crop ' . phpthumb_functions::escapeshellarg_replacement(($matches[1] - (2 * $width)) . 'x' . ($matches[2] - (2 * $width)) . '+0+0') . ' ', $commandline);
                                                        } elseif (preg_match('# \\-' . $IMresizeParameter . ' "([0-9]+)x([0-9]+)" #', $commandline, $matches)) {
                                                            $commandline = str_replace(
                                                                ' -' . $IMresizeParameter . ' "' . $matches[1] . 'x' . $matches[2] . '" ',
                Severity: Major
                Found in 0old/phpthumb/phpthumb.class.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 = [];
                          if (!$cached || !isset($file_exists_cache[$filename])) {
                  Severity: Minor
                  Found in 0old/phpthumb/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 (!phpthumb_functions::IsHexColor($color)) {
                                                              $color = ((!empty($this->bc)
                                                                         && phpthumb_functions::IsHexColor($this->bc)) ? $this->bc : '000000');
                                                          }
                  Severity: Major
                  Found in 0old/phpthumb/phpthumb.class.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                for ($y = 0; $y < $this->thumbnail_height; $y++) {
                                                    $PixelColor = phpthumb_functions::GetPixelColor($this->gdimg_output, $x, $y);
                                                    imagesetpixel($img_alpha_mixdown_dither, $x, $y, $dither_color[$PixelColor['alpha'] * 2]);
                                                }
                    Severity: Major
                    Found in 0old/phpthumb/phpthumb.class.php - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language