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 (function_exists('exif_thumbnail') && (@$this->getimagesizeinfo[2] == IMAGETYPE_JPEG)) {
            // Extract EXIF info from JPEGs

            $this->exif_thumbnail_width  = '';
            $this->exif_thumbnail_height = '';
Severity: Major
Found in phpthumb/phpthumb.class.php and 1 other location - About 7 hrs to fix
0old/phpthumb/phpthumb.class.php on lines 3495..3524

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

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

        if (function_exists('exif_thumbnail') && (IMAGETYPE_JPEG == $this->getimagesizeinfo[2])) {
            // Extract EXIF info from JPEGs

            $this->exif_thumbnail_width  = '';
            $this->exif_thumbnail_height = '';
Severity: Major
Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 7 hrs to fix
phpthumb/phpthumb.class.php on lines 3394..3423

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

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 phpthumb/phpthumb.class.php and 1 other location - About 7 hrs to fix
0old/phpthumb/phpthumb.class.php on lines 4110..4132

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

Function boucle has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

function boucle($nb_gen, $nloop)
{
    global $fathers, $mothers, $nbanims, $listing, $nl, $IDs;
    $nbtot   = 0;
    $listing = '';
Severity: Minor
Found in coi.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

File blocksadmin.php has 474 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: Minor
Found in admin/blocksadmin.php - About 7 hrs to fix

    File add_dog.php has 463 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: Minor
    Found in add_dog.php - About 7 hrs to fix

      File main.php has 445 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      //menublock
      define('_MA_PEDIGREE_VIEWSEARCH', 'View/Search ');
      define('_MA_PEDIGREE_ADD_A', 'Add a ');
      Severity: Minor
      Found in language/english/main.php - About 6 hrs to fix

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

                                            if (($scale > 1) || ($scale < 1)) {
                                                if ($img_watermark2 = phpthumb_functions::ImageCreateFunction($scale * imagesx($img_watermark), $scale * imagesy($img_watermark))) {
                                                    imagealphablending($img_watermark2, false);
                                                    imagesavealpha($img_watermark2, true);
                                                    $this->ImageResizeFunction($img_watermark2, $img_watermark, 0, 0, 0, 0, imagesx($img_watermark2), imagesy($img_watermark2), imagesx($img_watermark), imagesy($img_watermark));
        Severity: Major
        Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 6 hrs to fix
        phpthumb/phpthumb.class.php on lines 2961..2970

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

        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 (($scale > 1) || ($scale < 1)) {
                                                if ($img_watermark2 = phpthumb_functions::ImageCreateFunction($scale * imagesx($img_watermark), $scale * imagesy($img_watermark))) {
                                                    imagealphablending($img_watermark2, false);
                                                    imagesavealpha($img_watermark2, true);
                                                    $this->ImageResizeFunction($img_watermark2, $img_watermark, 0, 0, 0, 0, imagesx($img_watermark2), imagesy($img_watermark2), imagesx($img_watermark), imagesy($img_watermark));
        Severity: Major
        Found in phpthumb/phpthumb.class.php and 1 other location - About 6 hrs to fix
        0old/phpthumb/phpthumb.class.php on lines 3049..3058

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

        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

            getViewSize: function () {
                if (typeof window.innerWidth === 'number') {
                    return [window.innerWidth, window.innerHeight];
                } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    return [document.body.clientWidth, document.body.clientHeight];
        Severity: Major
        Found in assets/js/jscolor/jscolor.js and 1 other location - About 6 hrs to fix
        assets/js/jscolor/jscolor.js on lines 193..203

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

        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

            getViewPos: function () {
                if (typeof window.pageYOffset === 'number') {
                    return [window.pageXOffset, window.pageYOffset];
                } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
                    return [document.body.scrollLeft, document.body.scrollTop];
        Severity: Major
        Found in assets/js/jscolor/jscolor.js and 1 other location - About 6 hrs to fix
        assets/js/jscolor/jscolor.js on lines 206..216

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

        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 resize has a Cognitive Complexity of 43 (exceeds 5 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: Minor
        Found in library/Zebra_Image.php - About 6 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 ResolveFilenameToAbsolute has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function ResolveFilenameToAbsolute($filename)
            {
                if (empty($filename)) {
                    return false;
                }
        Severity: Minor
        Found in 0old/phpthumb/phpthumb.class.php - About 6 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 ResolveFilenameToAbsolute has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function ResolveFilenameToAbsolute($filename)
            {
                if (empty($filename)) {
                    return false;
                }
        Severity: Minor
        Found in phpthumb/phpthumb.class.php - About 6 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

        phpthumb_functions has 46 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class phpthumb_functions
        {
            public static function is_windows()
            {
                return (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN');
        Severity: Minor
        Found in phpthumb/phpthumb.functions.php - About 6 hrs to fix

          Function open has 157 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              open: function(data) {
          
                  var i;
          
                  if(data.isObj === false) {
          Severity: Major
          Found in assets/js/jquery.magnific-popup.js - About 6 hrs to fix

            Function listBlocks has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

                function listBlocks()
                {
                    global $xoopsModule, $pathIcon16;
                    require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                    $moduleDirName      = basename(\dirname(__DIR__));
            Severity: Minor
            Found in admin/blocksadmin.php - About 6 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 DropShadow has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

                public function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $alpha)
                {
                    if (phpthumb_functions::gd_version() < 2) {
                        return false;
                    }
            Severity: Minor
            Found in phpthumb/phpthumb.filters.php - About 6 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 menu_block has 154 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function menu_block()
            {
                $helper = Helper::getInstance();
            
                [$actlink, $even, $odd, $text, $hovlink, $head, $body, $title] = Utility::getColourScheme();
            Severity: Major
            Found in menu_block.php - About 6 hrs to fix

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

                  if ($phpThumb->gdimg_source = phpthumb_functions::ImageCreateFunction($phpThumb->w, $phpThumb->h)) {
                      $alpha = (100 - min(100, max(0, $opacity))) * 1.27;
                      if ($alpha) {
                          $phpThumb->setParameter('is_alpha', true);
                          imagealphablending($phpThumb->gdimg_source, false);
              Severity: Major
              Found in 0old/phpthumb/phpThumb.php and 1 other location - About 6 hrs to fix
              phpthumb/phpThumb.php on lines 603..614

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

              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