owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $inputPath = $input->getOption('path');
        $groups = $input->getOption('groups') ? \explode(',', $input->getOption('groups')) : [];
        $groups = \array_unique(\array_merge($groups, $input->getOption('group')));
        $shouldRepairStoragesIndividually = (bool) $input->getOption('repair');
Severity: Minor
Found in apps/files/lib/Command/Scan.php - About 1 hr to fix

    Method fopen has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function fopen($path, $mode) {
            $fullPath = $this->buildPath($path);
            $useExisting = true;
            switch ($mode) {
                case 'r':
    Severity: Minor
    Found in lib/private/Files/Storage/Flysystem.php - About 1 hr to fix

      Method deleteTags has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function deleteTags($tagIds) {
              if (!\is_array($tagIds)) {
                  $tagIds = [$tagIds];
              }
      
      
      Severity: Minor
      Found in lib/private/SystemTag/SystemTagManager.php - About 1 hr to fix

        Method getShareById has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getShareById($id, $recipientId = null) {
                if (!ctype_digit($id)) {
                    // share id is defined as a field of type integer
                    // if someone calls the API asking for a share id like "abc"
                    // then there is no point trying to query the database,
        Severity: Minor
        Found in lib/private/Share20/DefaultShareProvider.php - About 1 hr to fix

          Method getSharesBy has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getSharesBy($userId, $shareType, $path = null, $reshares = false, $limit = 50, $offset = 0) {
                  if ($path !== null &&
                          !($path instanceof \OCP\Files\File) &&
                          !($path instanceof \OCP\Files\Folder)) {
                      throw new \InvalidArgumentException('invalid path');
          Severity: Minor
          Found in lib/private/Share20/Manager.php - About 1 hr to fix

            Method decryptAllUsersFiles has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function decryptAllUsersFiles($user = '') {
                    $this->output->writeln("\n");
            
                    $progress = new ProgressBar($this->output);
                    $progress->setFormat(" %message% \n [%bar%]");
            Severity: Minor
            Found in lib/private/Encryption/DecryptAll.php - About 1 hr to fix

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

                  protected function execute(InputInterface $input, OutputInterface $output): int {
                      $t = new Table($output);
                      $displayInvalidJobs = $input->getOption('display-invalid-jobs');
                      $headers = ['Job ID', 'Job', 'Job Arguments', 'Last Run', 'Last Checked', 'Reserved At', 'Execution Duration (s)'];
                      if ($displayInvalidJobs) {
              Severity: Minor
              Found in core/Command/Background/Queue/Status.php - About 1 hr to fix

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

                        $appName,
                        IRequest $request,
                        IConfig $config,
                        IURLGenerator $urlGenerator,
                        IUserManager $userManager,
                Severity: Major
                Found in apps/files_sharing/lib/Controllers/ShareController.php - About 1 hr to fix

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

                                  if ($dir === '/' || $dir === '.') {
                                      $delimiter = \strrpos($filenameOnly, '.d');
                                      $timestamp = \substr($filenameOnly, $delimiter+2);
                                      $filenameOnlyWithoutTimestamp = \substr($filenameOnly, 0, $delimiter);
                                      $dirAndFilename = $filenameOnlyWithoutTimestamp;
                  Severity: Major
                  Found in apps/files_trashbin/lib/Trashbin.php and 1 other location - About 1 hr to fix
                  apps/files_trashbin/lib/Trashbin.php on lines 666..675

                  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 113.

                  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

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

                                  if ($dir === '/' || $dir === '.') {
                                      $delimiter = \strrpos($filenameOnly, '.d');
                                      $timestamp = \substr($filenameOnly, $delimiter+2);
                                      $filenameOnlyWithoutTimestamp = \substr($filenameOnly, 0, $delimiter);
                                      $dirAndFilename = $filenameOnlyWithoutTimestamp;
                  Severity: Major
                  Found in apps/files_trashbin/lib/Trashbin.php and 1 other location - About 1 hr to fix
                  apps/files_trashbin/lib/Trashbin.php on lines 839..848

                  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 113.

                  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

                              case '{'.self::NS_CALENDARSERVER.'}publish-calendar':
                  
                                  // We can only deal with IShareableCalendar objects
                                  if (!$node instanceof Calendar) {
                                      return;
                  Severity: Major
                  Found in apps/dav/lib/CalDAV/Publishing/PublishPlugin.php and 1 other location - About 1 hr to fix
                  apps/dav/lib/CalDAV/Publishing/PublishPlugin.php on lines 199..225

                  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 113.

                  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 releaseLock($path, $type, ILockingProvider $provider) {
                          /** @var \OCP\Files\Storage $targetStorage */
                          list($targetStorage, $targetInternalPath) = $this->resolvePath($path);
                          $targetStorage->releaseLock($targetInternalPath, $type, $provider);
                          // unlock the parent folders of the owner when unlocking the share as recipient
                  Severity: Major
                  Found in apps/files_sharing/lib/SharedStorage.php and 1 other location - About 1 hr to fix
                  apps/files_sharing/lib/SharedStorage.php on lines 376..385

                  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 113.

                  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 acquireLock($path, $type, ILockingProvider $provider) {
                          /** @var \OCP\Files\Storage $targetStorage */
                          list($targetStorage, $targetInternalPath) = $this->resolvePath($path);
                          $targetStorage->acquireLock($targetInternalPath, $type, $provider);
                          // lock the parent folders of the owner when locking the share as recipient
                  Severity: Major
                  Found in apps/files_sharing/lib/SharedStorage.php and 1 other location - About 1 hr to fix
                  apps/files_sharing/lib/SharedStorage.php on lines 392..401

                  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 113.

                  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

                              case '{'.self::NS_CALENDARSERVER.'}unpublish-calendar':
                  
                                  // We can only deal with IShareableCalendar objects
                                  if (!$node instanceof Calendar) {
                                      return;
                  Severity: Major
                  Found in apps/dav/lib/CalDAV/Publishing/PublishPlugin.php and 1 other location - About 1 hr to fix
                  apps/dav/lib/CalDAV/Publishing/PublishPlugin.php on lines 170..197

                  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 113.

                  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 _onClickRestoreSelected has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _onClickRestoreSelected: function(event) {
                              event.preventDefault();
                              var self = this;
                              var allFiles = this.$el.find('.select-all').is(':checked');
                              var files = [];
                  Severity: Minor
                  Found in apps/files_trashbin/js/filelist.js - About 1 hr to fix

                    Function attach has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            attach: function(fileList) {
                                this._extendFileActions(fileList);
                    
                                var oldCreateRow = fileList._createRow;
                                fileList._createRow = function(fileData) {
                    Severity: Minor
                    Found in apps/files/js/filelockplugin.js - About 1 hr to fix

                      Function send has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                      send = function () {
                                          that._sending += 1;
                                          // Set timer for bitrate progress calculation:
                                          options._bitrateTimer = new that._BitrateTimer();
                                          jqXHR = jqXHR || (
                      Severity: Minor
                      Found in apps/files/js/jquery.fileupload.js - About 1 hr to fix

                        Function _checkSecurityHeaders has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                _checkSecurityHeaders: function(xhr) {
                                    var messages = [];
                        
                                    if (xhr.status === 200) {
                                        var securityHeaders = {
                        Severity: Minor
                        Found in core/js/setupchecks.js - About 1 hr to fix

                          Function _checkSSL has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  _checkSSL: function(xhr) {
                                      var messages = [];
                          
                                      if (xhr.status === 200) {
                                          var docPlaceholderUrl = '';
                          Severity: Minor
                          Found in core/js/setupchecks.js - About 1 hr to fix

                            Function filePath has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                filePath: function (app, type, file) {
                                    var isCore = OC.coreApps.indexOf(app) !== -1,
                                        link = OC.getRootPath();
                                    if (file.substring(file.length - 3) === 'php' && !isCore) {
                                        link += '/index.php/apps/' + app;
                            Severity: Minor
                            Found in core/js/js.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language