owncloud/core

View on GitHub

Showing 3,236 of 4,502 total issues

Avoid too many return statements within this method.
Open

            return new TimeFactory();
Severity: Major
Found in core/Application.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return new DataResponse([
                    "code" => "INVALID_PARAMETER",
                    "message" => "the file already exists"
                ], 403);
    Severity: Major
    Found in core/Controller/AppRegistryController.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return $c->query('ServerContainer')->getEncryptionManager()->isEnabled();
      Severity: Major
      Found in core/Application.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return new TokenController(
                        $c->query('AppName'),
                        $c->query('Request'),
                        $c->query('UserManager'),
                        $c->query('ServerContainer')->query('OC\Authentication\Token\IProvider'),
        Severity: Major
        Found in core/Application.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $c->query('ServerContainer')->getSecureRandom();
          Severity: Major
          Found in core/Application.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return new DataResponse([
                            "code" => "INVALID_PARAMETER",
                            "message" => $e->getMessage()
                        ], 400);
            Severity: Major
            Found in core/Controller/AppRegistryController.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return new TwoFactorChallengeController(
                              $c->query('AppName'),
                              $c->query('Request'),
                              $c->query('TwoFactorAuthManager'),
                              $c->query('UserSession'),
              Severity: Major
              Found in core/Application.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return $c->query('ServerContainer')->getCache();
                Severity: Major
                Found in core/Application.php - About 30 mins to fix

                  Function _onNotificationEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _onNotificationEvent: function(e) {
                          if (e.notification.app === 'files_sharing') {
                              if (this._inFileList) {
                                  this._inFileList.reload();
                              }
                  Severity: Minor
                  Found in apps/files_sharing/js/app.js - About 25 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 _saveToOwnCloud has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _saveToOwnCloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
                          var that = this;
                  
                          var toggleLoading = function () {
                              var isLoading = !that.$saveToOcButton.find('#save-to-oc-button-loading').hasClass('hidden');
                  Severity: Minor
                  Found in apps/files_sharing/js/public.js - About 25 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 _shareStateActionHandler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _shareStateActionHandler: function(context, newState) {
                          var targetFileData = context.fileList.elementToFile(context.$file);
                          var isRemote = targetFileData.shareLocationType === 'remote';
                          const shareType = targetFileData.shareType;
                          function responseCallback(response, status) {
                  Severity: Minor
                  Found in apps/files_sharing/js/app.js - About 25 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 processMountStatusIndividual has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      processMountStatusIndividual: function (mountData, mountStatus) {
                  
                          var mountPoint = mountData.mount_point;
                          if (mountStatus.status > 0) {
                              var trElement = FileList.findFileEl(OCA.External.StatusManager.Utils.jqSelEscape(mountPoint));
                  Severity: Minor
                  Found in apps/files_external/js/statusmanager.js - About 25 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 computerFileSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      computerFileSize: function (string) {
                          if (typeof string !== 'string') {
                              return null;
                          }
                  
                  
                  Severity: Minor
                  Found in core/js/js.js - About 25 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 _updateProgressBar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _updateProgressBar: function() {
                          var progress = parseInt(this.$uploadprogressbar.attr('data-loaded'), 10);
                          var total = parseInt(this.$uploadprogressbar.attr('data-total'), 10);
                          if (progress !== this._lastProgress) {
                              this._lastProgress = progress;
                  Severity: Minor
                  Found in apps/files/js/file-upload.js - About 25 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 hide has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      hide: function ($row, callback) {
                          var self = this;
                          var $notification = $('#notification');
                  
                          if (_.isFunction($row)) {
                  Severity: Minor
                  Found in core/js/js.js - About 25 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      register: function(appName, bundle, pluralForm) {
                          var self = this;
                          if (_.isUndefined(this._bundles[appName])) {
                              this._bundles[appName] = bundle || {};
                  
                  
                  Severity: Minor
                  Found in core/js/l10n.js - About 25 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 resetDone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      resetDone : function(result){
                          var resetErrorMsg;
                          if (result && result.status === 'success'){
                              $.post(
                                      OC.webroot + '/',
                  Severity: Minor
                  Found in core/js/lostpassword.js - About 25 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 _formatRemoteShare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _formatRemoteShare: function(remoteAddress) {
                          var parts = this._REMOTE_OWNER_REGEXP.exec(remoteAddress);
                          if (!parts) {
                              // display as is, most likely to be a simple owner name
                              return escapeHTML(remoteAddress);
                  Severity: Minor
                  Found in core/js/share.js - About 25 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 destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function destroy($id) {
                          $userId = $this->userSession->getUser()->getUID();
                          $user = $this->userManager->get($id);
                  
                          if ($userId === $id) {
                  Severity: Minor
                  Found in settings/Controller/UsersController.php - About 25 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 changeMail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function changeMail($token, $userId) {
                          $user = $this->userManager->get($userId);
                          $sessionUser = $this->userSession->getUser();
                  
                          if ($user->getUID() !== $sessionUser->getUID()) {
                  Severity: Minor
                  Found in settings/Controller/UsersController.php - About 25 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