mambax7/pedigree

View on GitHub

Showing 702 of 1,100 total issues

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

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

        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

          Function colpick has 398 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var colpick = function () {
                  var
                      tpl = '<div class="colpick"><div class="colpick_color"><div class="colpick_color_overlay1"><div class="colpick_color_overlay2"><div class="colpick_selector_outer"><div class="colpick_selector_inner"></div></div></div></div></div><div class="colpick_hue"><div class="colpick_hue_arrs"><div class="colpick_hue_larr"></div><div class="colpick_hue_rarr"></div></div></div><div class="colpick_new_color"></div><div class="colpick_current_color"></div><div class="colpick_hex_field"><div class="colpick_field_letter">#</div><input type="text" maxlength="6" size="6" /></div><div class="colpick_rgb_r colpick_field"><div class="colpick_field_letter">R</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_g colpick_field"><div class="colpick_field_letter">G</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_h colpick_field"><div class="colpick_field_letter">H</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_s colpick_field"><div class="colpick_field_letter">S</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_submit"></div></div>',
                      defaults = {
                          showEvent: 'click',
          Severity: Major
          Found in assets/js/colpick.js - About 1 day to fix

            Function WatermarkText has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
            Open

                public function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color = '000000', $ttffont = '', $opacity = 100, $margin = 5, $angle = 0, $bg_color = false, $bg_opacity = 0, $fillextend = '', $lineheight = 1.0)
                {
                    // text watermark requested
                    if (!$text) {
                        return false;
            Severity: Minor
            Found in phpthumb/phpthumb.filters.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 colors.php has 690 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 admin/colors.php - About 1 day to fix

              Function ExtractEXIFgetImageSize has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function ExtractEXIFgetImageSize()
                  {
                      $this->DebugMessage('starting ExtractEXIFgetImageSize()', __FILE__, __LINE__);
              
                      if (preg_match('#^http:#i', $this->src) && !$this->sourceFilename && $this->rawImageData) {
              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 phpthumb.bmp.php has 643 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /////////////////////////////////////////////////////////////////
              /// getID3() by James Heinrich <info@getid3.org>               //
              //  available at http://getid3.sourceforge.net                 //
              //            or http://www.getid3.org                         //
              Severity: Major
              Found in phpthumb/phpthumb.bmp.php - About 1 day to fix

                File Utility.php has 629 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace XoopsModules\Pedigree;
                
                /*
                Severity: Major
                Found in class/Utility.php - About 1 day to fix

                  Method pedigree_main has 277 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function pedigree_main($ID)
                  {
                      global $xoopsTpl;
                      global $xoopsModuleConfig;
                  
                  
                  Severity: Major
                  Found in pedigree2.php - About 1 day to fix

                    Function ExtractEXIFgetImageSize has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function ExtractEXIFgetImageSize()
                        {
                            $this->DebugMessage('starting ExtractEXIFgetImageSize()', __FILE__, __LINE__);
                    
                            if (preg_match('#^http:#i', $this->src) && !$this->sourceFilename && $this->rawImageData) {
                    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 URI has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                    Open

                        URI: function (uri) { // See RFC3986
                    
                            this.scheme = null;
                            this.authority = null;
                            this.path = '';
                    Severity: Minor
                    Found in assets/js/jscolor/jscolor.js - 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 phpThumb.php has 590 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.php - About 1 day to fix

                      Function pedigree_main has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function pedigree_main($ID)
                      {
                          global $xoopsTpl;
                          global $xoopsModuleConfig;
                      
                      
                      Severity: Minor
                      Found in pedigree2.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 pedigreeUtilities0.php has 585 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      namespace XoopsModules\Pedigree;
                      
                      $moduleDirName = \basename(\dirname(__DIR__));
                      Severity: Major
                      Found in 0old/pedigreeUtilities0.php - About 1 day to fix

                        Method SourceImageToGD has 247 lines of code (exceeds 25 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: Major
                        Found in phpthumb/phpthumb.class.php - About 1 day to fix

                          Method WatermarkText has 247 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color = '000000', $ttffont = '', $opacity = 100, $margin = 5, $angle = 0, $bg_color = false, $bg_opacity = 0, $fillextend = '', $lineheight = 1.0)
                              {
                                  // text watermark requested
                                  if (!$text) {
                                      return false;
                          Severity: Major
                          Found in phpthumb/phpthumb.filters.php - About 1 day to fix
                            Severity
                            Category
                            Status
                            Source
                            Language