mambax7/pedigree

View on GitHub

Showing 1,100 of 1,100 total issues

Function ImageMagickThumbnailToGD has a Cognitive Complexity of 566 (exceeds 5 allowed). Consider refactoring.
Open

    public function ImageMagickThumbnailToGD()
    {
        // http://www.imagemagick.org/script/command-line-options.php

        $this->useRawIMoutput = true;
Severity: Minor
Found in phpthumb/phpthumb.class.php - About 1 wk 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 phpthumb.class.php has 3883 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.class.php - About 1 wk to fix

    Function ImageMagickThumbnailToGD has a Cognitive Complexity of 536 (exceeds 5 allowed). Consider refactoring.
    Open

        public function ImageMagickThumbnailToGD()
        {
            // http://www.imagemagick.org/script/command-line-options.php
    
            $this->useRawIMoutput = true;
    Severity: Minor
    Found in 0old/phpthumb/phpthumb.class.php - About 1 wk 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 phpthumb.class.php has 3797 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 0old/phpthumb/phpthumb.class.php - About 1 wk to fix

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

                              if (@is_readable($filename) && ($fp_watermark = @fopen($filename, 'rb'))) {
                                  $WatermarkImageData = '';
                                  do {
                                      $buffer             = fread($fp_watermark, 8192);
                                      $WatermarkImageData .= $buffer;
      Severity: Major
      Found in phpthumb/phpthumb.class.php and 1 other location - About 5 days to fix
      0old/phpthumb/phpthumb.class.php on lines 2967..3018

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

      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 (@is_readable($filename) && ($fp_watermark = @fopen($filename, 'rb'))) {
                                  $WatermarkImageData = '';
                                  do {
                                      $buffer             = fread($fp_watermark, 8192);
                                      $WatermarkImageData .= $buffer;
      Severity: Major
      Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 5 days to fix
      phpthumb/phpthumb.class.php on lines 2877..2929

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

      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 ApplyFilters has a Cognitive Complexity of 241 (exceeds 5 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: Minor
      Found in phpthumb/phpthumb.class.php - About 4 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 ApplyFilters has a Cognitive Complexity of 239 (exceeds 5 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: Minor
      Found in 0old/phpthumb/phpthumb.class.php - About 4 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 color has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
      Open

          color: function (target, prop) {
      
      
              this.required = true; // refuse empty values?
              this.adjust = true; // adjust value to uniform notation?
      Severity: Minor
      Found in assets/js/jscolor/jscolor.js - About 4 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

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

                          case 'size': // Resize
                              @list($newwidth, $newheight, $stretch) = explode('|', $parameter);
                              $newwidth  = (!$newwidth ? imagesx($this->gdimg_output) : ((($newwidth > 0) && ($newwidth < 1)) ? round($newwidth * imagesx($this->gdimg_output)) : round($newwidth)));
                              $newheight = (!$newheight ? imagesy($this->gdimg_output) : ((($newheight > 0) && ($newheight < 1)) ? round($newheight * imagesy($this->gdimg_output)) : round($newheight)));
                              $stretch   = ($stretch ? true : false);
      Severity: Major
      Found in phpthumb/phpthumb.class.php and 1 other location - About 4 days to fix
      0old/phpthumb/phpthumb.class.php on lines 3142..3172

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

      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

                          case 'size': // Resize
                              @list($newwidth, $newheight, $stretch) = explode('|', $parameter);
                              $newwidth  = (!$newwidth ? imagesx($this->gdimg_output) : ((($newwidth > 0)
                                                                                          && ($newwidth < 1)) ? round($newwidth * imagesx($this->gdimg_output)) : round($newwidth)));
                              $newheight = (!$newheight ? imagesy($this->gdimg_output) : ((($newheight > 0)
      Severity: Major
      Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 4 days to fix
      phpthumb/phpthumb.class.php on lines 3061..3089

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

      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
      
      namespace XoopsModules\Pedigree\Form;
      
      /*
      Severity: Major
      Found in class/Form/TempForm.php and 1 other location - About 3 days to fix
      class/Form/TrashForm.php on lines 1..98

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

      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
      
      namespace XoopsModules\Pedigree\Form;
      
      /*
      Severity: Major
      Found in class/Form/TrashForm.php and 1 other location - About 3 days to fix
      class/Form/TempForm.php on lines 1..98

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

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

      function userfields($field = 0)
      {
          global $field;
          require_once __DIR__ . '/include/checkoutwizard.php';
      
      
      Severity: Minor
      Found in tools.php - About 3 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 getid3_bmp has a Cognitive Complexity of 174 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getid3_bmp(&$BMPdata, &$ThisFileInfo, $ExtractPalette = false, $ExtractData = false)
          {
              // shortcuts
              $ThisFileInfo['bmp']['header']['raw'] = [];
              $thisfile_bmp                         = &$ThisFileInfo['bmp'];
      Severity: Minor
      Found in phpthumb/phpthumb.bmp.php - About 3 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 jquery.magnific-popup.js has 1325 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*! Magnific Popup - v1.1.0 - 2016-02-20
      * http://dimsemenov.com/plugins/magnific-popup/
      * Copyright (c) 2016 Dmitry Semenov; */
      ;(function (factory) {
      if (typeof define === 'function' && define.amd) {
      Severity: Major
      Found in assets/js/jquery.magnific-popup.js - About 3 days to fix

        Function color has 670 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            color: function (target, prop) {
        
        
                this.required = true; // refuse empty values?
                this.adjust = true; // adjust value to uniform notation?
        Severity: Major
        Found in assets/js/jscolor/jscolor.js - About 3 days to fix

          Method ImageMagickThumbnailToGD has 663 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function ImageMagickThumbnailToGD()
              {
                  // http://www.imagemagick.org/script/command-line-options.php
          
                  $this->useRawIMoutput = true;
          Severity: Major
          Found in phpthumb/phpthumb.class.php - About 3 days to fix

            File phpthumb.filters.php has 1242 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.filters.php - About 3 days to fix

              Method ImageMagickThumbnailToGD has 643 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function ImageMagickThumbnailToGD()
                  {
                      // http://www.imagemagick.org/script/command-line-options.php
              
                      $this->useRawIMoutput = true;
              Severity: Major
              Found in 0old/phpthumb/phpthumb.class.php - About 3 days to fix
                Severity
                Category
                Status
                Source
                Language