XoopsModules25x/smallworld

View on GitHub

Showing 759 of 1,838 total issues

Avoid deeply nested control flow statements.
Open

                        if ( (event.result = ret) === false ) {
                            event.preventDefault();
                            event.stopPropagation();
                        }
Severity: Major
Found in assets/js/jquery.min.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
                                cur += clazz + " ";
                            }
    Severity: Major
    Found in assets/js/jquery.min.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ( rscriptType.test( node.type || "" ) &&
                                  !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
      
                                  if ( node.src ) {
                                      // Optional AJAX dependency, but won't run scripts if not present
      Severity: Major
      Found in assets/js/jquery.min.js - About 45 mins to fix

        Function md5 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        String.prototype.md5 = function () {
            var a = function (a, b) {
                var c = (a & 65535) + (b & 65535);
                var d = (a >> 16) + (b >> 16) + (c >> 16);
                return d << 16 | c & 65535
        Severity: Minor
        Found in assets/js/jquery.oembed.js - About 45 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 historyInit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            historyInit: function (callback, src) {
                xoops_smallworld.historyCallback = callback;
                if (src) xoops_smallworld.historyIframeSrc = src;
                var current_hash = location.hash.replace(/\?.*$/, '');
        
        
        Severity: Minor
        Found in assets/js/jquery.history.js - About 45 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

        Avoid deeply nested control flow statements.
        Open

                            if ( copyIsArray ) {
                                copyIsArray = false;
                                clone = src && jQuery.isArray(src) ? src : [];
        
                            } else {
        Severity: Major
        Found in assets/js/jquery.min.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          } else if (xoops_smallworld.historyBackStack[xoops_smallworld.historyBackStack.length - 1] == undefined && !xoops_smallworld.isFirst) {
                              // back button has been pushed to beginning and URL already pointed to hash (e.g. a bookmark)
                              // document.URL doesn't change in Safari
                              if (location.hash) {
                                  var current_hash = location.hash;
          Severity: Major
          Found in assets/js/jquery.history.js - About 45 mins to fix

            Function easeOutBack has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                        easeOutBack: function (x, t, b, c, d, s) {
            Severity: Minor
            Found in assets/js/jquery-ui-1.8.11.custom.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                                      if (_part.toLowerCase().indexOf(_request.term.toLowerCase()) != -1) {
                                                          _place = xoops_smallworld.trim(_part);
                                                          return false; // break
                                                      }
              Severity: Major
              Found in assets/js/ui.geo_autocomplete_now.js - About 45 mins to fix

                Function easeInBack has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                            easeInBack: function (x, t, b, c, d, s) {
                Severity: Minor
                Found in assets/js/jquery-ui-1.8.11.custom.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              switch (col) {
                                                  case 0:
                                                      calender += ' ui-datepicker-group-first';
                                                      cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left');
                                                      break;
                  Severity: Major
                  Found in assets/js/jquery-ui-1.8.11.custom.js - About 45 mins to fix

                    Function easeInOutBack has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                                easeInOutBack: function (x, t, b, c, d, s) {
                    Severity: Minor
                    Found in assets/js/jquery-ui-1.8.11.custom.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if (_place_parts[1] != '') {
                                                              var _place2 = _place_parts[1].toLowerCase();
                                                              var placeresult = xoops_smallworld.trim(_place1);
                                                          }
                      Severity: Major
                      Found in assets/js/ui.geo_autocomplete_now.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                            if (_place_parts[1] == undefined) {
                                                                var _place2 = '???';
                                                                var placeresult = xoops_smallworld.trim(_place1);
                                                            }
                        Severity: Major
                        Found in assets/js/ui.geo_autocomplete_now.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (lookAhead("'"))
                                                              output += "'";
                                                          else
                                                              literal = true;
                          Severity: Major
                          Found in assets/js/jquery-ui-1.8.11.custom.js - About 45 mins to fix

                            Function create_thumbnail has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function create_thumbnail($file_name)
                                {
                                    $file_path      = $this->upload_dir . $file_name;
                                    $thumbnail_path = $this->thumbnails_dir . $file_name;
                                    list($img_width, $img_height) = @getimagesize($file_path);
                            Severity: Minor
                            Found in class/uploadclass.php - About 45 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 sendMails has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function sendMails($fromUserId, $toUserId, $event, $link, array $data)
                                {
                                    $date    = date('m-d-Y H:i:s', time());
                                    $mail    = new \XoopsMultiMailer();
                                    $wall    = new WallUpdates();
                            Severity: Minor
                            Found in class/Mail.php - About 45 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

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

                            function smallworld_search($queryarray, $andor, $limit, $offset, $userid, $sortby = 'created DESC')
                            Severity: Minor
                            Found in include/search.inc.php - About 45 mins to fix

                              Function usersettings has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function usersettings($userid)
                                  {
                                      $form = "<div style='display:none'><div class='smallworld_usersetings'>";
                                      $form .= '<fieldset><legend>' . _SMALLWORLD_SHOWIFPUBLICORPRIVATE . '</legend>';
                                      $form .= "<form id='perset'>";
                              Severity: Minor
                              Found in class/Form.php - About 45 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 download has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function download()
                                  {
                                      if (!$this->options['download_via_php']) {
                                          $this->header('HTTP/1.1 403 Forbidden');
                              
                              
                              Severity: Minor
                              Found in class/UploadHandler.php - About 45 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