owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method execute has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $confirmed = $input->getOption('continue');
        if (($confirmed !== 'yes') && ($confirmed !== 'no')) {
            $output->writeln('Continue can accept either yes or no');
            return 2;
Severity: Major
Found in core/Command/Encryption/DecryptAll.php - About 2 hrs to fix

    Method execute has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output): int {
            if (\OCP\Util::needUpgrade()) {
                $output->writeln('Update required, skipping cron');
                return 1;
            }
    Severity: Major
    Found in core/Command/System/Cron.php - About 2 hrs to fix

      File uk.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      OC.L10N.register(
          "settings",
          {
          "Wrong current password" : "Хибний поточний пароль",
          "The new password cannot be the same as the previous one" : "Новий пароль не може бути таким самим як і попередній",
      Severity: Minor
      Found in settings/l10n/uk.js - About 2 hrs to fix

        File ro.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        OC.L10N.register(
            "core",
            {
            "Please select a file." : "Te rugăm să alegi un fișier.",
            "File is too big" : "Fișierul este prea mare",
        Severity: Minor
        Found in core/l10n/ro.js - About 2 hrs to fix

          File Storage.php has 253 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * @author Björn Schießle <bjoern@schiessle.org>
           * @author Joas Schilling <coding@schilljs.com>
           * @author Lukas Reschke <lukas@statuscode.ch>
          Severity: Minor
          Found in apps/files_sharing/lib/External/Storage.php - About 2 hrs to fix

            File files.php has 253 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
             * @author Bart Visscher <bartv@thisnet.nl>
             * @author Björn Schießle <bjoern@schiessle.org>
            Severity: Minor
            Found in lib/private/legacy/files.php - About 2 hrs to fix

              Similar blocks of code found in 3 locations. Consider refactoring.
              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 and 2 other locations - About 2 hrs to fix
              core/js/sharedialogview.js on lines 247..271
              core/js/sharedialogview.js on lines 255..271

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 76.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  getSendStatusNode : function(){
                      if (!$('#lost-password').length){
                          $('<p id="lost-password"></p>').insertBefore($('#remember_login'));
                      } else {
                          $('#lost-password').replaceWith($('<p id="lost-password"></p>'));
              Severity: Major
              Found in core/js/lostpassword.js and 1 other location - About 2 hrs to fix
              core/js/lostpassword.js on lines 145..152

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 76.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                                          } else if (share.share_type === OC.Share.SHARE_TYPE_GROUP) {
                                              groupsLength = groups.length;
                                              for (j = 0; j < groupsLength; j++) {
                                                  if (groups[j].value.shareWith === share.share_with) {
                                                      groups.splice(j, 1);
              Severity: Major
              Found in core/js/sharedialogview.js and 2 other locations - About 2 hrs to fix
              core/js/sharedialogview.js on lines 247..271
              core/js/sharedialogview.js on lines 263..271

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 76.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  getResetStatusNode : function (){
                      if (!$('#lost-password').length){
                          $('#reset-password .submit-wrap').prepend($('<p id="lost-password"></p>'));
                      } else {
                          $('#lost-password').replaceWith($('<p id="lost-password"></p>'));
              Severity: Major
              Found in core/js/lostpassword.js and 1 other location - About 2 hrs to fix
              core/js/lostpassword.js on lines 67..74

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 76.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                                          if (share.share_type === OC.Share.SHARE_TYPE_USER) {
                                              usersLength = users.length;
                                              for (j = 0; j < usersLength; j++) {
                                                  if (users[j].value.shareWith === share.share_with) {
                                                      users.splice(j, 1);
              Severity: Major
              Found in core/js/sharedialogview.js and 2 other locations - About 2 hrs to fix
              core/js/sharedialogview.js on lines 255..271
              core/js/sharedialogview.js on lines 263..271

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 76.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  public function unlockFile($path, $type, $lockMountPoint = false) {
                      $absolutePath = $this->getAbsolutePath($path);
                      $absolutePath = Filesystem::normalizePath($absolutePath);
                      if (!$this->shouldLockFile($absolutePath)) {
                          return false;
              Severity: Major
              Found in lib/private/Files/View.php and 1 other location - About 2 hrs to fix
              lib/private/Files/View.php on lines 2143..2158

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 122.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  public function lockFile($path, $type, $lockMountPoint = false) {
                      $absolutePath = $this->getAbsolutePath($path);
                      $absolutePath = Filesystem::normalizePath($absolutePath);
                      if (!$this->shouldLockFile($absolutePath)) {
                          return false;
              Severity: Major
              Found in lib/private/Files/View.php and 1 other location - About 2 hrs to fix
              lib/private/Files/View.php on lines 2169..2184

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 122.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function getMountStatusForMount has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getMountStatusForMount: function (mountData, afterCallback) {
                      var self = this;
                      if (typeof afterCallback !== 'function' || self.isGetMountStatusRunning) {
                          return $.Deferred().resolve();
                      }
              Severity: Major
              Found in apps/files_external/js/statusmanager.js - About 2 hrs to fix

                Function _extendFileActions has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _extendFileActions: function(fileActions) {
                            var self = this;
                            // register "star" action
                            fileActions.registerAction({
                                name: 'Favorite',
                Severity: Major
                Found in apps/files/js/tagsplugin.js - About 2 hrs to fix

                  Function render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          render: function () {
                              var isPasswordSet = !!this.model.get('encryptedPassword');
                  
                              // only show email field for new shares and if enabled globally
                              var showEmailField = this.configModel.isMailPublicNotificationEnabled();
                  Severity: Major
                  Found in core/js/sharedialoglinkshareview.js - About 2 hrs to fix

                    Function markFileAsShared has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        markFileAsShared: function($tr, hasShares, hasLink) {
                            var action = $tr.find('.fileactions .action[data-action="Share"]');
                            var type = $tr.data('type');
                            var icon = action.find('.icon');
                            var message;
                    Severity: Major
                    Found in core/js/share.js - About 2 hrs to fix

                      Function appSettings has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          appSettings: function (args) {
                              if (typeof args === 'undefined' || typeof args.appid === 'undefined') {
                                  throw {name: 'MissingParameter', message: 'The parameter appid is missing'};
                              }
                              var props = {scriptName: 'settings.php', cache: true};
                      Severity: Major
                      Found in core/js/js.js - About 2 hrs to fix

                        Function tipsy has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        jQuery.fn.tipsy = function (argument) {
                            console.warn('Deprecation warning: tipsy is deprecated. Use tooltip instead.');
                            if (typeof argument === 'object' && argument !== null) {
                        
                                // tipsy defaults
                        Severity: Major
                        Found in core/js/js.js - About 2 hrs to fix

                          Method schedule has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function schedule(ITip\Message $iTipMessage) {
                                  // Not sending any emails if OC-CalDav-Import header is set
                                  if ($this->request->getHeader('OC-CalDav-Import') !== null) {
                                      return;
                                  }
                          Severity: Major
                          Found in apps/dav/lib/CalDAV/Schedule/IMipPlugin.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language