mambax7/pedigree

View on GitHub

Showing 1,100 of 1,100 total issues

Function SourceImageToGD has a Cognitive Complexity of 139 (exceeds 5 allowed). Consider refactoring.
Open

    public function SourceImageToGD()
    {
        if (is_resource($this->gdimg_source) || (is_object($this->gdimg_source) && $this->gdimg_source instanceof \GdImage)) {
            $this->source_width  = imagesx($this->gdimg_source);
            $this->source_height = imagesy($this->gdimg_source);
Severity: Minor
Found in phpthumb/phpthumb.class.php - About 2 days 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

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

<?php
// 
// _LANGCODE: en
// _CHARSET : UTF-8
// Translator: XOOPS Translation Team
Severity: Major
Found in language/english/banners.php and 1 other location - About 2 days to fix
language/english/comment.php on lines 1..45

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

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

<?php
// 
// _LANGCODE: en
// _CHARSET : UTF-8
// Translator: XOOPS Translation Team
Severity: Major
Found in language/english/comment.php and 1 other location - About 2 days to fix
language/english/banners.php on lines 1..59

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

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 SourceImageToGD has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
Open

    public function SourceImageToGD()
    {
        if (is_resource($this->gdimg_source)) {
            $this->source_width  = imagesx($this->gdimg_source);
            $this->source_height = imagesy($this->gdimg_source);
Severity: Minor
Found in 0old/phpthumb/phpthumb.class.php - About 2 days 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 tools.php has 964 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 You may not change or alter any portion of this comment or credits
 of supporting developers from this source code or any supporting source code
 which is considered copyrighted (c) material of the original comment or credit authors.
Severity: Major
Found in tools.php - About 2 days to fix

    File phpthumb.functions.php has 962 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    //////////////////////////////////////////////////////////////
    //   phpThumb() by James Heinrich <info@silisoftware.com>   //
    //        available at http://phpthumb.sourceforge.net      //
    //         and/or https://github.com/JamesHeinrich/phpThumb //
    Severity: Major
    Found in phpthumb/phpthumb.functions.php - About 2 days to fix

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

              if ($filename && ($getimagesizeinfo = @getimagesize($filename))) {
                  if (!$this->SourceImageIsTooLarge($getimagesizeinfo[0], $getimagesizeinfo[1])) {
                      $ImageCreateFromFunction = [
                          1  => 'imagecreatefromgif',
                          2  => 'imagecreatefromjpeg',
      Severity: Major
      Found in phpthumb/phpthumb.class.php and 1 other location - About 2 days to fix
      0old/phpthumb/phpthumb.class.php on lines 3735..3787

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

      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 ($filename && ($getimagesizeinfo = @getimagesize($filename))) {
                  if (!$this->SourceImageIsTooLarge($getimagesizeinfo[0], $getimagesizeinfo[1])) {
                      $ImageCreateFromFunction = [
                          1  => 'imagecreatefromgif',
                          2  => 'imagecreatefromjpeg',
      Severity: Major
      Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 2 days to fix
      phpthumb/phpthumb.class.php on lines 3604..3657

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

      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

      File jscolor.js has 943 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * jscolor, JavaScript Color Picker
       *
       * @version 1.4.3
       * @license GNU Lesser General Public License, https://www.gnu.org/copyleft/lesser.html
      Severity: Major
      Found in assets/js/jscolor/jscolor.js - About 2 days to fix

        File coi.php has 922 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*
         You may not change or alter any portion of this comment or credits of
         supporting developers from this source code or any supporting source code
         which is considered copyrighted (c) material of the original comment or credit
        Severity: Major
        Found in coi.php - About 2 days to fix

          Function CleanUpCacheDirectory has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
          Open

              public function CleanUpCacheDirectory()
              {
                  $this->DebugMessage(
                      'CleanUpCacheDirectory() set to purge (' . (null === $this->config_cache_maxage ? 'NULL' : number_format($this->config_cache_maxage / 86400, 1)) . ' days; ' . (null === $this->config_cache_maxsize ? 'NULL' : number_format($this->config_cache_maxsize / 1048576, 2)) . ' MB; ' . (null
                                                                                                                                                                                                                                                                                                            === $this->config_cache_maxfiles ? 'NULL' : number_format(
          Severity: Minor
          Found in 0old/phpthumb/phpthumb.class.php - About 2 days 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 CleanUpCacheDirectory has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
          Open

              public function CleanUpCacheDirectory()
              {
                  $this->DebugMessage(
                      'CleanUpCacheDirectory() set to purge (' . (null === $this->config_cache_maxage ? 'NULL' : number_format($this->config_cache_maxage / 86400, 1)) . ' days; ' . (null === $this->config_cache_maxsize ? 'NULL' : number_format($this->config_cache_maxsize / 1048576, 2)) . ' MB; ' . (null
                                                                                                                                                                                                                                                                                                            === $this->config_cache_maxfiles ? 'NULL' : number_format(
          Severity: Minor
          Found in phpthumb/phpthumb.class.php - About 2 days 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

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

                  if (is_file($this->config_nooffsitelink_watermark_src)) {
                      if (!require_once __DIR__ . '/phpthumb.filters.php') {
                          $this->DebugMessage('Error including "' . __DIR__ . '/phpthumb.filters.php" which is required for applying watermark', __FILE__, __LINE__);
          
                          return false;
          Severity: Major
          Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 2 days to fix
          phpthumb/phpthumb.class.php on lines 2537..2562

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

          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 (is_file($this->config_nooffsitelink_watermark_src)) {
                          if (!include_once __DIR__ . '/phpthumb.filters.php') {
                              $this->DebugMessage('Error including "' . __DIR__ . '/phpthumb.filters.php" which is required for applying watermark', __FILE__, __LINE__);
                              return false;
                          }
          Severity: Major
          Found in phpthumb/phpthumb.class.php and 1 other location - About 2 days to fix
          0old/phpthumb/phpthumb.class.php on lines 2635..2661

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

          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 getid3_bmp has 423 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getid3_bmp(&$BMPdata, &$ThisFileInfo, $ExtractPalette = false, $ExtractData = false)
              {
                  // shortcuts
                  $ThisFileInfo['bmp']['header']['raw'] = [];
                  $thisfile_bmp                         = &$ThisFileInfo['bmp'];
          Severity: Major
          Found in phpthumb/phpthumb.bmp.php - About 2 days to fix

            Method ApplyFilters has 408 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function ApplyFilters()
                {
                    if ($this->fltr && is_array($this->fltr)) {
                        if (!require_once __DIR__ . '/phpthumb.filters.php') {
                            $this->DebugMessage('Error including "' . __DIR__ . '/phpthumb.filters.php" which is required for applying filters (' . implode(';', $this->fltr) . ')', __FILE__, __LINE__);
            Severity: Major
            Found in 0old/phpthumb/phpthumb.class.php - About 2 days to fix

              File phpthumb.gif.php has 844 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              ///////////////////////////////////////////////////////////////////////////////////////////////////
              // GIF Util - (C) 2003 Yamasoft (S/C)
              // http://www.yamasoft.com
              // All Rights Reserved
              Severity: Major
              Found in phpthumb/phpthumb.gif.php - About 2 days to fix

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

                                        if ($this->zc) {
                                            $borderThickness = 0;
                                            if (!empty($this->fltr)) {
                                                foreach ($this->fltr as $key => $value) {
                                                    if (preg_match('#^bord\|([0-9]+)#', $value, $matches)) {
                Severity: Major
                Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 2 days to fix
                phpthumb/phpthumb.class.php on lines 1739..1869

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

                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 ($this->zc) {
                                            $borderThickness = 0;
                                            if (!empty($this->fltr)) {
                                                foreach ($this->fltr as $key => $value) {
                                                    if (preg_match('#^bord\|([\d]+)#', $value, $matches)) {
                Severity: Major
                Found in phpthumb/phpthumb.class.php and 1 other location - About 2 days to fix
                0old/phpthumb/phpthumb.class.php on lines 1842..1961

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

                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 ApplyFilters has 405 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function ApplyFilters()
                    {
                        if ($this->fltr && is_array($this->fltr)) {
                            if (!include_once __DIR__ . '/phpthumb.filters.php') {
                                $this->DebugMessage('Error including "' . __DIR__ . '/phpthumb.filters.php" which is required for applying filters (' . implode(';', $this->fltr) . ')', __FILE__, __LINE__);
                Severity: Major
                Found in phpthumb/phpthumb.class.php - About 2 days to fix
                  Severity
                  Category
                  Status
                  Source
                  Language