mambax7/pedigree

View on GitHub

Showing 1,100 of 1,100 total issues

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

        if ($this->new) {
            $broad_directory_name = strtolower(md5($this->new));
            $this->cache_filename .= '_new' . $broad_directory_name;
        } elseif ($this->md5s) {
            // source image MD5 hash provided
Severity: Major
Found in phpthumb/phpthumb.class.php and 1 other location - About 1 day to fix
0old/phpthumb/phpthumb.class.php on lines 3619..3635

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

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

Function drawPicker has 219 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function drawPicker(x, y) {
            if (!jscolor.picker) {
                jscolor.picker = {
                    box: document.createElement('div'),
                    boxB: document.createElement('div'),
Severity: Major
Found in assets/js/jscolor/jscolor.js - About 1 day to fix

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

                switch (@$this->getimagesizeinfo[2]) {
                    case 6:
                        ob_start();
                        if (!@require_once __DIR__ . '/phpthumb.bmp.php') {
                            ob_end_clean();
    Severity: Major
    Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 1 day to fix
    phpthumb/phpthumb.class.php on lines 3888..3924

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

    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 2 locations. Consider refactoring.
    Open

                switch (@$this->getimagesizeinfo[2]) {
                    case 6:
                        ob_start();
                        if (!@include_once __DIR__ . '/phpthumb.bmp.php') {
                            ob_end_clean();
    Severity: Major
    Found in phpthumb/phpthumb.class.php and 1 other location - About 1 day to fix
    0old/phpthumb/phpthumb.class.php on lines 4015..4051

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

    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

    Method listBlocks has 213 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function listBlocks()
        {
            global $xoopsModule, $pathIcon16;
            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
            $moduleDirName      = basename(\dirname(__DIR__));
    Severity: Major
    Found in admin/blocksadmin.php - About 1 day to fix

      phpthumb has 59 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class phpthumb
      {
          // public:
          // START PARAMETERS (for object mode and phpThumb.php)
          // See phpthumb.readme.txt for descriptions of what each of these values are
      Severity: Major
      Found in phpthumb/phpthumb.class.php - About 1 day to fix

        phpthumb has 58 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class phpthumb
        {
            // public:
            // START PARAMETERS (for object mode and phpThumb.php)
            // See phpthumb.readme.txt for descriptions of what each of these values are
        Severity: Major
        Found in 0old/phpthumb/phpthumb.class.php - About 1 day to fix

          Function truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function truncateHtml(
                  string $text,
                  ?int $length = 100,
                  ?string $ending = '...',
                  ?bool $exact = false,
          Severity: Minor
          Found in class/Common/SysUtility.php - About 1 day 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 Rotate has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

              public function Rotate()
              {
                  if ($this->ra || $this->ar) {
                      if (!function_exists('imagerotate')) {
                          $this->DebugMessage('!function_exists(imagerotate)', __FILE__, __LINE__);
          Severity: Minor
          Found in 0old/phpthumb/phpthumb.class.php - About 1 day 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 Rotate has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

              public function Rotate()
              {
                  if ($this->ra || $this->ar) {
                      if (!function_exists('imagerotate')) {
                          $this->DebugMessage('!function_exists(imagerotate)', __FILE__, __LINE__);
          Severity: Minor
          Found in phpthumb/phpthumb.class.php - About 1 day 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

          File colpick.js has 509 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           colpick Color Picker
           Copyright 2013 Jose Vargas. Licensed under GPL license. Based on Stefan Petre's Color Picker www.eyecon.ro, dual licensed under the MIT and GPL licenses
          
           For usage and examples: colpick.com/plugin
          Severity: Major
          Found in assets/js/colpick.js - About 1 day to fix

            Method phpThumbDebug has 205 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function phpThumbDebug($level = '')
                {
                    if ($level && ($this->phpThumbDebug !== $level)) {
                        return true;
                    }
            Severity: Major
            Found in phpthumb/phpthumb.class.php - About 1 day to fix

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

                  if ($phpThumb->config_mysql_extension == 'mysqli') {
                      $found_missing_function = false;
                      foreach (['mysqli_connect'] as $required_mysqli_function) {
                          if (!function_exists($required_mysqli_function)) {
                              $found_missing_function = $required_mysqli_function;
              Severity: Major
              Found in phpthumb/phpThumb.php and 1 other location - About 1 day to fix
              0old/phpthumb/phpThumb.php on lines 304..377

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

              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 2 locations. Consider refactoring.
              Open

                  if ('mysqli' === $phpThumb->config_mysql_extension) {
                      $found_missing_function = false;
                      foreach (['mysqli_connect'] as $required_mysqli_function) {
                          if (!function_exists($required_mysqli_function)) {
                              $found_missing_function = $required_mysqli_function;
              Severity: Major
              Found in 0old/phpthumb/phpThumb.php and 1 other location - About 1 day to fix
              phpthumb/phpThumb.php on lines 303..376

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

              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 2 locations. Consider refactoring.
              Open

                                                      if (preg_match('# \\-crop "([\d]+)x([\d]+)\\+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 phpthumb/phpthumb.class.php and 1 other location - About 1 day to fix
              0old/phpthumb/phpthumb.class.php on lines 2269..2277

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

              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 2 locations. Consider refactoring.
              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 and 1 other location - About 1 day to fix
              phpthumb/phpthumb.class.php on lines 2185..2193

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

              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

              Function ImageCreateFromStringReplacement has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors = false)
                  {
                      // there are serious bugs in the non-bundled versions of GD which may cause
                      // PHP to segfault when calling imagecreatefromstring() - avoid if at all possible
                      // when not using a bundled version of GD2
              Severity: Minor
              Found in phpthumb/phpthumb.class.php - About 7 hrs 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 ImageCreateFromStringReplacement has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors = false)
                  {
                      // there are serious bugs in the non-bundled versions of GD which may cause
                      // PHP to segfault when calling imagecreatefromstring() - avoid if at all possible
                      // when not using a bundled version of GD2
              Severity: Minor
              Found in 0old/phpthumb/phpthumb.class.php - About 7 hrs 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 resize has 189 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function resize($width = 0, $height = 0, $method = ZEBRA_IMAGE_CROP_CENTER, $background_color = -1)
                  {
                      // if image resource was successfully created
                      if ($this->_create_from_source()) {
                          // if either width or height is to be adjusted automatically
              Severity: Major
              Found in library/Zebra_Image.php - About 7 hrs to fix

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

                    public function phpThumbDebugVarDump($var)
                    {
                        if (null === $var) {
                            return 'NULL';
                        } elseif (is_bool($var)) {
                Severity: Major
                Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 7 hrs to fix
                phpthumb/phpthumb.class.php on lines 4018..4038

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

                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