mambax7/pedigree

View on GitHub

Showing 1,100 of 1,100 total issues

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

    public function ImageMagickSwitchAvailable($switchname)
    {
        static $IMoptions = null;
        if (null === $IMoptions) {
            $IMoptions   = [];
Severity: Major
Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 1 day to fix
phpthumb/phpthumb.class.php on lines 1508..1538

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

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

    public function ImageMagickSwitchAvailable($switchname)
    {
        static $IMoptions = null;
        if (null === $IMoptions) {
            $IMoptions   = [];
Severity: Major
Found in phpthumb/phpthumb.class.php and 1 other location - About 1 day to fix
0old/phpthumb/phpthumb.class.php on lines 1623..1654

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

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

        File Zebra_Image.php has 574 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         *  Methods used with the {@link resize()} method.
         */
        Severity: Major
        Found in library/Zebra_Image.php - About 1 day to fix

          Function gd_info has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
          Open

              function gd_info()
              {
                  static $gd_info = [];
                  if (empty($gd_info)) {
                      // based on code by johnschaefer at gmx dot de
          Severity: Minor
          Found in phpthumb/phpthumb.functions.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

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

              public static function createThumbs($filename)
              {
                  /*
                  require_once __DIR__ . '/phpthumb/phpthumb.class.php';
                  $thumbnail_widths = array(150, 400);
          Severity: Major
          Found in 0old/pedigreeUtilities0.php and 1 other location - About 1 day to fix
          class/Utility.php on lines 159..271

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

          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

              public static function createThumbs($filename)
              {
                  /*
                      require_once __DIR__ . '/phpthumb/phpthumb.class.php';
                      $thumbnail_widths = array(150, 400);
          Severity: Major
          Found in class/Utility.php and 1 other location - About 1 day to fix
          0old/pedigreeUtilities0.php on lines 89..201

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

          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

          $querystring .= 'mmm.coi as mmm_coi FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' d
                       LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' f ON d.father = f.id
                       LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' m ON d.mother = m.id
                       LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' ff ON f.father = ff.id
                       LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' fff ON ff.father = fff.id
          Severity: Major
          Found in pedigree.php and 1 other location - About 1 day to fix
          print.php on lines 32..86

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

          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

          $sql = '
          SELECT d.Id as d_id,
          d.pname as d_pname,
          d.roft as d_roft,
          d.foto as d_foto,
          Severity: Major
          Found in print.php and 1 other location - About 1 day to fix
          pedigree.php on lines 69..84

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

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

            Function menu_block has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
            Open

            function menu_block()
            {
                $helper = Helper::getInstance();
            
                [$actlink, $even, $odd, $text, $hovlink, $head, $body, $title] = Utility::getColourScheme();
            Severity: Minor
            Found in menu_block.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 functions.php has 551 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 include/functions.php - About 1 day to fix

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

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

                File phpThumb.php has 544 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.php - About 1 day to fix

                  Method userfields has 226 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function userfields($field = 0)
                  {
                      global $field;
                      require_once __DIR__ . '/include/checkoutwizard.php';
                  
                  
                  Severity: Major
                  Found in tools.php - About 1 day to fix

                    Function menu_block has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function menu_block()
                    {
                        $moduleDirName = basename(\dirname(__DIR__));
                        $helper        = Helper::getInstance();
                    
                    
                    Severity: Minor
                    Found in blocks/menu_block.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

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

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language