owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Avoid deeply nested control flow statements.
Open

                        if ($.isFunction(this.callback)) {
                            $.when.apply($, this.deferredsList)
                                .always($.proxy(function(){
                                    this.callback();
                                }, this)
Severity: Major
Found in apps/files_external/js/rollingqueue.js - About 45 mins to fix

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

        preSortSearchString: function(a, b) {
            var pattern = this.filter;
            if(typeof pattern === 'undefined') {
                return undefined;
            }
    Severity: Minor
    Found in settings/js/users/users.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 register has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            register: function(mime, name, permissions, icon, action, displayName) {
    Severity: Minor
    Found in apps/files/js/fileactions.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if (options.uniqueFilenames) {
                                          fileName = that._getUniqueFilename(
                                              fileName,
                                              options.uniqueFilenames
                                          );
      Severity: Major
      Found in apps/files/js/jquery.fileupload.js - About 45 mins to fix

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

            window.FileActions.register = function (mime, name, permissions, icon, action, displayName) {
        Severity: Minor
        Found in apps/files/js/fileactions.js - About 45 mins to fix

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

                  loadPreview: function(path, mime, etag, $iconDiv, $container, isImage) {
          Severity: Minor
          Found in apps/files/js/mainfileinfodetailview.js - About 45 mins to fix

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

            $.fn.position = function( options ) {
                if ( !options || !options.of ) {
                    return _position.apply( this, arguments );
                }
            
            
            Severity: Minor
            Found in core/js/js.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 (upload) {
                                        var response = upload.getResponse();
                                        message = t('files', 'Failed to upload the file "{fileName}": {error}', {fileName: upload.getFileName(), error: response.message});
                                    }
            Severity: Major
            Found in apps/files/js/file-upload.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (!paramNameSlice.length) {
                                          paramNameSlice = paramName;
                                      }
              Severity: Major
              Found in apps/files/js/jquery.fileupload.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                for (j = 0; j < groupsLength; j++) {
                                                    if (groups[j].value.shareWith === share.share_with) {
                                                        groups.splice(j, 1);
                                                        break;
                                                    }
                Severity: Major
                Found in core/js/sharedialogview.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                          if (res.found[i].shareWith === OC.currentUser) {
                                                              res.found.splice(i, 1);
                                                              continue;
                                                          }
                  Severity: Major
                  Found in core/js/sharedialogview.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (w >= -1 && w <= 1) {
                                                    //hermite filter
                                                    weight = 2 * w * w * w - 3 * w * w + 1;
                                                    if (weight > 0) {
                                                        dx = 4 * (xx + yy * W);
                    Severity: Major
                    Found in core/js/oc-dialogs.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (!$('#app-sidebar').hasClass('hidden') && !$('#app-sidebar').hasClass('disappear')) {
                                                  controlsWidth -= $('#app-sidebar').width();
                                              }
                      Severity: Major
                      Found in core/js/js.js - About 45 mins to fix

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

                            loadItem:function(itemType, itemSource, callback) {
                                var data = '';
                                var checkReshare = true;
                                var async = !_.isUndefined(callback);
                                if (typeof OC.Share.statuses[itemSource] === 'undefined') {
                        Severity: Minor
                        Found in core/js/share.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 (!$('#app-sidebar').hasClass('hidden') && !$('#app-sidebar').hasClass('disappear')) {
                                                    controlsWidth -= $('#app-sidebar').width();
                                                }
                        Severity: Major
                        Found in core/js/js.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

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

                            Avoid deeply nested control flow statements.
                            Open

                                                        } else if (share.share_type === OC.Share.SHARE_TYPE_REMOTE) {
                                                            remotesLength = remotes.length;
                                                            for (j = 0; j < remotesLength; j++) {
                                                                if (remotes[j].value.shareWith === share.share_with) {
                                                                    remotes.splice(j, 1);
                            Severity: Major
                            Found in core/js/sharedialogview.js - About 45 mins to fix

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

                                  $.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) {
                              Severity: Minor
                              Found in core/js/jquery.avatar.js - About 45 mins to fix

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

                                        _moveOrCopy: function(operation, path, destinationPath, allowOverwrite, headers, options) {
                                Severity: Minor
                                Found in core/js/files/client.js - About 45 mins to fix

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

                                      translatePlural: function(app, textSingular, textPlural, count, vars, options) {
                                  Severity: Minor
                                  Found in core/js/l10n.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language