mambax7/pedigree

View on GitHub

Showing 702 of 1,100 total issues

Method createList has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createList($result, $prefix, $link, $element)
{
    global $xoopsTpl;
    $animal = new Pedigree\Animal();
    //test to find out how many user fields there are...
Severity: Major
Found in include/functions.php - About 3 hrs to fix

    Method ImageCreateFromFilename has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function ImageCreateFromFilename($filename)
        {
            // try to create GD image source directly via GD, if possible,
            // rather than buffering to memory and creating with imagecreatefromstring
            $ImageCreateWasAttempted = false;
    Severity: Major
    Found in 0old/phpthumb/phpthumb.class.php - About 3 hrs to fix

      Method ImageCreateFromFilename has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function ImageCreateFromFilename($filename)
          {
              // try to create GD image source directly via GD, if possible,
              // rather than buffering to memory and creating with imagecreatefromstring
              $ImageCreateWasAttempted = false;
      Severity: Major
      Found in phpthumb/phpthumb.class.php - About 3 hrs to fix

        Function _create_from_source has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _create_from_source()
            {
                // perform some error checking first
                // if the GD library is not installed
                if (!function_exists('gd_info')) {
        Severity: Minor
        Found in library/Zebra_Image.php - About 3 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 chrono_sort has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        function chrono_sort()
        {
            global $IDs, $inds, $fathers, $mothers, $chrono, $nl, $detail;
            $impr  = 0;
            $modif = 1;
        Severity: Minor
        Found in coi.php - About 3 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 completeCallback has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public function completeCallback()
            {
                //can this field be searched
                $search = $this->getValue('hassearch');
                if ('hassearch' === $search) {
        Severity: Minor
        Found in class/CheckoutWizard.php - About 3 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 applyUnsharpMask has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function applyUnsharpMask(&$img, $amount, $radius, $threshold)
            {
                // $img is an image that is already created within php using
                // imgcreatetruecolor. No url! $img must be a truecolor image.
        
        
        Severity: Minor
        Found in phpthumb/phpthumb.unsharp.php - About 3 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 pedigree2.php has 295 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        // -------------------------------------------------------------------------
        
        //require_once \dirname(__DIR__, 2) . '/mainfile.php';
        use Xmf\Request;
        Severity: Minor
        Found in pedigree2.php - About 3 hrs to fix

          Method createList has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function createList($result, $prefix, $link, $element)
              {
                  global $xoopsTpl;
                  $animal = new Pedigree\Animal();
                  //test to find out how many user fields there are...
          Severity: Major
          Found in 0old/pedigreeUtilities0.php - About 3 hrs to fix

            Method SafeURLread has 76 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function SafeURLread($url, &$error, $timeout = 10, $followredirects = true)
                {
                    $error   = '';
                    $errstr  = '';
                    $rawData = '';
            Severity: Major
            Found in phpthumb/phpthumb.functions.php - About 3 hrs to fix

              ZervWizard has 26 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class ZervWizard
              {
                  // whether or not all steps of the form are complete
                  public $_complete = false;
                  // internal array to store the various steps
              Severity: Minor
              Found in class/ZervWizard.php - About 3 hrs to fix

                Method Rotate has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function Rotate()
                    {
                        if ($this->ra || $this->ar) {
                            if (!function_exists('imagerotate')) {
                                $this->DebugMessage('!function_exists(imagerotate)', __FILE__, __LINE__);
                Severity: Major
                Found in 0old/phpthumb/phpthumb.class.php - About 3 hrs to fix

                  Method Rotate has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function Rotate()
                      {
                          if ($this->ra || $this->ar) {
                              if (!function_exists('imagerotate')) {
                                  $this->DebugMessage('!function_exists(imagerotate)', __FILE__, __LINE__);
                  Severity: Major
                  Found in phpthumb/phpthumb.class.php - About 3 hrs to fix

                    Method GENEALOGY has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function GENEALOGY()
                    {
                        global $IDs, $fathers, $mothers, $inds, $nb_gen, $nb_maxi, $nbani, $nl, $sql1;
                        $impr       = 0;
                        $fathers[0] = $IDs[1];
                    Severity: Major
                    Found in coi.php - About 2 hrs to fix

                      Method getBmp has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getBmp($bgColor)
                          {
                              $out = '';
                      
                              if (!$this->m_bLoaded) {
                      Severity: Major
                      Found in phpthumb/phpthumb.gif.php - About 2 hrs to fix

                        Method getPng has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getPng($bgColor)
                            {
                                $out = '';
                        
                                if (!$this->m_bLoaded) {
                        Severity: Major
                        Found in phpthumb/phpthumb.gif.php - About 2 hrs to fix

                          Method AlphaChannelFlatten has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function AlphaChannelFlatten()
                              {
                                  if (!$this->is_alpha) {
                                      // image doesn't have alpha transparency, no need to flatten
                                      $this->DebugMessage('skipping AlphaChannelFlatten() because !$this->is_alpha', __FILE__, __LINE__);
                          Severity: Major
                          Found in phpthumb/phpthumb.class.php - About 2 hrs to fix

                            Function calc_dist has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function calc_dist() /* Common Ascendants and their distances */
                            {
                                global $IDs, $fathers, $mothers, $nbanims, $pater, $mater, $empty, $nb_gen, $nl;
                                global $dmax, $detail, $nb_gen;
                                $distan = [];
                            Severity: Minor
                            Found in coi.php - About 2 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 phpThumbDebug has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function phpThumbDebug($level = '')
                                {
                                    if ($level && ($this->phpThumbDebug !== $level)) {
                                        return true;
                                    }
                            Severity: Minor
                            Found in 0old/phpthumb/phpthumb.class.php - About 2 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 checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function checkVerModule(
                                    \Xmf\Module\Helper $helper,
                                    ?string $source = 'github',
                                    ?string $default = 'master'
                                ): array {
                            Severity: Minor
                            Found in class/Common/VersionChecks.php - About 2 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

                            Severity
                            Category
                            Status
                            Source
                            Language