owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

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

                      showDropDown:function(itemType, itemSource, appendTo, link, possiblePermissions, filename) {
                  Severity: Minor
                  Found in core/js/share.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;
                                                case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
                                                    cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
                    Severity: Major
                    Found in core/js/js.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              while (path != last) {
                                                  if (path === data.path && !data.link) {
                                                      var actions = $fileList.find('.fileactions .action[data-action="Share"]');
                                                      var files = $fileList.find('.filename');
                                                      var i;
                      Severity: Major
                      Found in core/js/share.js - About 45 mins to fix

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

                            _handlePickerClick:function(event, $element) {
                                var getOcDialog = this.$filePicker.closest('.oc-dialog');
                                var buttonEnableDisable = getOcDialog.find('.primary');
                                if ($element.data('type') === 'file') {
                                    if (this.$filePicker.data('multiselect') !== true || !event.ctrlKey) {
                        Severity: Minor
                        Found in core/js/oc-dialogs.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

                                        } else if ( copy !== undefined ) {
                                            target[ name ] = copy;
                                        }
                        Severity: Major
                        Found in core/js/js.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

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

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

                                    $appName,
                                    IRequest $request,
                                    ICertificateManager $userCertificateManager,
                                    ICertificateManager $systemCertificateManager,
                                    IL10N $l10n,
                            Severity: Minor
                            Found in settings/Controller/CertificateController.php - About 45 mins to fix

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

                                  private function checkCoreMailMap($author) {
                                      if (empty($this->mailMap)) {
                                          $content = \file_get_contents(__DIR__ . '/../.mailmap');
                                          $entries = \explode("\n", $content);
                                          foreach ($entries as $entry) {
                              Severity: Minor
                              Found in build/license.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

                              Avoid deeply nested control flow statements.
                              Open

                                                          if (query.length > 2) {
                                                              self.search(query);
                                                          } else {
                                                              self.hideResults();
                                                          }
                              Severity: Major
                              Found in core/search/js/search.js - About 45 mins to fix

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

                                    private function isValidUrl(string $url) {
                                        $parsedUrl = \parse_url($url);
                                
                                        if (!\filter_var($url, FILTER_VALIDATE_URL) || !$parsedUrl) {
                                            return  false;
                                Severity: Minor
                                Found in settings/Controller/CorsController.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 setEmailAddress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function setEmailAddress($id, $mailAddress) {
                                        $resp = $this->validateEMail($mailAddress);
                                        if ($resp) {
                                            return $resp;
                                        }
                                Severity: Minor
                                Found in settings/Controller/UsersController.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