mambax7/pedigree

View on GitHub

Showing 702 of 1,100 total issues

Method ImageCopyResampleBicubic has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function ImageCopyResampleBicubic($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
    {
        // ron at korving dot demon dot nl
        // http://www.php.net/imagecopyresampled

Severity: Minor
Found in phpthumb/phpthumb.functions.php - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if ((is_resource($gdimg_dest) || (is_object($gdimg_dest) && $gdimg_dest instanceof \GdImage)) && (is_resource($img_watermark) || (is_object($img_watermark) && $img_watermark instanceof \GdImage))) {
                $img_source_width          = imagesx($gdimg_dest);
                $img_source_height         = imagesy($gdimg_dest);
                $watermark_source_width    = imagesx($img_watermark);
                $watermark_source_height   = imagesy($img_watermark);
    Severity: Critical
    Found in phpthumb/phpthumb.filters.php - About 1 hr to fix

      Method pedigree_fields_form has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function pedigree_fields_form()
      {
          $config_fields = pedigree_get_config_fields();
          $values        = pedigree_get_config();
          print "
      Severity: Minor
      Found in admin/fields.php - About 1 hr to fix

        Method lettersChoice has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function lettersChoice()
        {
            $helper = Helper::getInstance();
            $helper->loadLanguage('main');
            xoops_load('XoopsLocal');
        Severity: Minor
        Found in include/functions.php - About 1 hr to fix

          Method load has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function load($data, &$datLen)
              {
                  $datLen = 0;
          
                  while (true) {
          Severity: Minor
          Found in phpthumb/phpthumb.gif.php - About 1 hr to fix

            Method ResolveSource has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function ResolveSource()
                {
                    if (is_resource($this->gdimg_source) || (is_object($this->gdimg_source) && $this->gdimg_source instanceof \GdImage)) {
                        $this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__);
                        return true;
            Severity: Minor
            Found in phpthumb/phpthumb.class.php - About 1 hr to fix

              Method CleanUpURLencoding has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function CleanUpURLencoding($url, $queryseperator = '&')
                  {
                      if (!0 === stripos($url, "http")) {
                          return $url;
                      }
              Severity: Minor
              Found in phpthumb/phpthumb.functions.php - About 1 hr to fix

                Method SKETCH_PEDIGREE has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function SKETCH_PEDIGREE()
                {
                    global $nl, $detail, $depth, $IDs;
                    // print_r ($IDs) ;
                    echo $nl
                Severity: Minor
                Found in coi.php - About 1 hr to fix

                  Function _parseMarkup has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _parseMarkup: function(template, values, item) {
                          var arr;
                          if(item.data) {
                              values = $.extend(item.data, values);
                          }
                  Severity: Minor
                  Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

                    Method updateBlock has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
                        {
                            $myblock = new \XoopsBlock($bid);
                            $myblock->setVar('title', $btitle);
                            $myblock->setVar('weight', $bweight);
                    Severity: Minor
                    Found in admin/blocksadmin.php - About 1 hr to fix

                      Method loadTableFromArrayWithReplace has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function loadTableFromArrayWithReplace($table, $data, $search, $replace)
                      {
                          /** @var \XoopsMySQLDatabase $db */
                          $db = \XoopsDatabaseFactory::getDatabaseConnection();
                      
                      
                      Severity: Minor
                      Found in testdata/index.php - About 1 hr to fix

                        Method calc_dist has 32 lines of code (exceeds 25 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 1 hr to fix

                          Method lettersChoice has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function lettersChoice($myObject, $activeObject, $criteria, $name, $link, $link2 = null)
                              {
                                  /** @var \XoopsModules\Pedigree\Helper $helper */
                                  $helper = Helper::getInstance();
                                  $helper->loadLanguage('main');
                          Severity: Minor
                          Found in class/Utility.php - About 1 hr to fix

                            Method getFileStatus has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
                                {
                                    global $pathIcon16;
                            
                                    if (empty($file_path)) {
                            Severity: Minor
                            Found in class/Common/FileChecker.php - About 1 hr to fix

                              Method GD2BMPstring has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function GD2BMPstring(&$gd_image)
                                  {
                                      $imageX = imagesx($gd_image);
                                      $imageY = imagesy($gd_image);
                              
                              
                              Severity: Minor
                              Found in phpthumb/phpthumb.bmp.php - About 1 hr to fix

                                Method skipExt has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function skipExt(&$data, &$extLen)
                                    {
                                        $extLen = 0;
                                
                                        $b    = ord($data[0]);
                                Severity: Minor
                                Found in phpthumb/phpthumb.gif.php - About 1 hr to fix

                                  Method WhiteBalance has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function WhiteBalance(&$gdimg, $targetColor = '')
                                      {
                                          if (phpthumb_functions::IsHexColor($targetColor)) {
                                              $targetPixel = [
                                                  'red'   => hexdec(substr($targetColor, 0, 2)),
                                  Severity: Minor
                                  Found in phpthumb/phpthumb.filters.php - About 1 hr to fix

                                    Function output_animal has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function output_animal($ind, $gen, $class)
                                    {
                                        global $depth, $IDs, $fathers, $mothers, $nl;
                                        if ($gen > $depth) {
                                            return 0;
                                    Severity: Minor
                                    Found in coi.php - About 1 hr 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 bind has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        bind: function () {
                                            var matchClass = new RegExp('(^|\\s)(' + jscolor.bindClass + ')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
                                            var e = document.getElementsByTagName('input');
                                            for (var i = 0; i < e.length; i += 1) {
                                                var m;
                                    Severity: Minor
                                    Found in assets/js/jscolor/jscolor.js - About 1 hr 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 FixedAspectRatio has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function FixedAspectRatio()
                                        {
                                            // optional fixed-dimension images (regardless of aspect ratio)
                                    
                                            if (!$this->far) {
                                    Severity: Minor
                                    Found in 0old/phpthumb/phpthumb.class.php - About 1 hr 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