mambax7/pedigree

View on GitHub

Showing 702 of 1,100 total issues

Avoid deeply nested control flow statements.
Open

                        switch ($errno) {
                            case 200:
                                // great, continue
                                break;

Severity: Major
Found in phpthumb/phpthumb.functions.php - About 45 mins to fix

    Method URLreadFsock has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function URLreadFsock($host, $file, &$errstr, $successonly = true, $port = -1, $timeout = 10)
    Severity: Minor
    Found in phpthumb/phpthumb.functions.php - About 45 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
                  return;
              }
      Severity: Major
      Found in assets/js/jquery.magnific-popup.js - About 40 mins to fix

        Method pedigree_search has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function pedigree_search($queryarray, $andor, $limit, $offset, $userid)
        Severity: Minor
        Found in include/search.inc.php - About 35 mins to fix

          Method apply_filter has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function apply_filter($filter, $arg1 = '', $arg2 = '', $arg3 = '', $arg4 = '')
          Severity: Minor
          Found in library/Zebra_Image.php - About 35 mins to fix

            Function TCBuildCell has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function TCBuildCell(R, G, B, w, h) {
            Severity: Minor
            Found in assets/js/picker.js - About 35 mins to fix

              Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      string $text,
                      ?int $length = 100,
                      ?string $ending = '...',
                      ?bool $exact = false,
                      ?bool $considerHtml = true
              Severity: Minor
              Found in class/Common/SysUtility.php - About 35 mins to fix

                Method ImprovedImageRotate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function ImprovedImageRotate(&$gdimg_source, $rotate_angle = 0, $config_background_hexcolor = 'FFFFFF', $bg = null, &$phpThumbObject)
                Severity: Minor
                Found in phpthumb/phpthumb.filters.php - About 35 mins to fix

                  Method Crop has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function Crop(&$gdimg, $left = 0, $right = 0, $top = 0, $bottom = 0)
                  Severity: Minor
                  Found in phpthumb/phpthumb.filters.php - About 35 mins to fix

                    Method ImageColorAllocateAlphaSafe has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static function ImageColorAllocateAlphaSafe(&$gdimg_hexcolorallocate, $R, $G, $B, $alpha = false)
                    Severity: Minor
                    Found in phpthumb/phpthumb.functions.php - About 35 mins to fix

                      Method ImageBorder has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function ImageBorder(&$gdimg, $border_width, $radius_x, $radius_y, $hexcolor_border)
                      Severity: Minor
                      Found in phpthumb/phpthumb.filters.php - About 35 mins to fix

                        Function getViewPos has a Cognitive Complexity of 7 (exceeds 5 allowed). 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: Minor
                        Found in assets/js/jscolor/jscolor.js - About 35 mins 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 TCPaint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function TCPaint(c, b_noPref) {
                            c = (b_noPref ? '' : '#') + c.toUpperCase();
                            if (this.o_samp)
                                this.o_samp.innerHTML = '<span  style="font-family: Tahoma; font-size: x-small; ">' + c + ' <span style="color: white; ">' + c + '</span></span>';
                            if (this.doc.layers)
                        Severity: Minor
                        Found in assets/js/picker.js - About 35 mins 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 detectDir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            detectDir: function () {
                                var base = location.href;
                        
                                var e = document.getElementsByTagName('base');
                                for (var i = 0; i < e.length; i += 1) {
                        Severity: Minor
                        Found in assets/js/jscolor/jscolor.js - About 35 mins 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 isInOpenBasedir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function isInOpenBasedir($path)
                            {
                                static $open_basedirs = null;
                                if (null === $open_basedirs) {
                                    $ini_text = ini_get('open_basedir');
                        Severity: Minor
                        Found in 0old/phpthumb/phpthumb.class.php - About 35 mins 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 setSourceData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function setSourceData($rawImageData, $sourceFilename = '')
                            {
                                //$this->resetObject();
                                //$this->sourceFilename = null;
                                $this->rawImageData = $rawImageData;
                        Severity: Minor
                        Found in 0old/phpthumb/phpthumb.class.php - About 35 mins 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 getParents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function getParents()
                            {
                                $parents = ['mother' => ['id' => 0, 'name' => ''], 'father' => ['id' => 0, 'name' => '']]; //init the
                                //get the Tree Handler and retrieve parent info
                                $treeHandler = XoopsModules\Pedigree\Helper::getInstance()->getHandler('Tree');
                        Severity: Minor
                        Found in class/Tree.php - About 35 mins 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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function getEditor(?\Xmf\Module\Helper $helper = null, ?array $options = null)
                            {
                                /** @var Helper $helper */
                                if (null === $options) {
                                    $options           = [];
                        Severity: Minor
                        Found in class/Common/SysUtility.php - About 35 mins 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 getDirectoryStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function getDirectoryStatus($path, $mode = 0777, $redirectFile = null)
                            {
                                global $pathIcon16;
                        
                                if (empty($path)) {
                        Severity: Minor
                        Found in class/Common/DirectoryChecker.php - About 35 mins 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 load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function load($lpData, &$hdrLen)
                            {
                                $hdrLen = 0;
                        
                                $this->m_lpVer = substr($lpData, 0, 6);
                        Severity: Minor
                        Found in phpthumb/phpthumb.gif.php - About 35 mins 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