owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method getPublicCalendars has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getPublicCalendars() {
        $fields = \array_values($this->propertyMap);
        $fields[] = 'a.id';
        $fields[] = 'a.uri';
        $fields[] = 'a.synctoken';
Severity: Minor
Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 1 hr to fix

    Method reShare has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function reShare($id) {
            $token = $this->request->getParam('token', null);
            $shareWith = $this->request->getParam('shareWith', null);
            $permission = $this->request->getParam('permission', null);
            $remoteId = $this->request->getParam('remoteId', null);

      Method createCardsPropertiesTable has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function createCardsPropertiesTable(Schema $schema) {
              if (!$schema->hasTable("{$this->prefix}cards_properties")) {
                  $table = $schema->createTable("{$this->prefix}cards_properties");
                  $table->addColumn('id', 'integer', [
                      'autoincrement' => true,
      Severity: Minor
      Found in apps/dav/appinfo/Migrations/Version20170116150538.php - About 1 hr to fix

        Method createTag has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function createTag($data, $contentType = 'application/json'): ISystemTag {
                if (\explode(';', $contentType)[0] === 'application/json') {
                    $data = \json_decode($data, true);
                } else {
                    throw new UnsupportedMediaType();
        Severity: Minor
        Found in apps/dav/lib/SystemTag/SystemTagPlugin.php - About 1 hr to fix

          Method handleGetProperties has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function handleGetProperties(PropFind $propFind, INode $node) {
                  if ($node instanceof MetaFolder) {
                      $propFind->handle(self::PATH_FOR_FILEID_PROPERTYNAME, function () use ($node) {
                          $fileId = $node->getName();
          
          
          Severity: Minor
          Found in apps/dav/lib/Meta/MetaPlugin.php - About 1 hr to fix

            Method rename has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function rename($path1, $path2) {
                    $file = $this->getDriveFile($path1);
                    if ($file) {
                        $newFile = $this->getDriveFile($path2);
                        $toUpdate = new DriveFile();
            Severity: Minor
            Found in apps/files_external/lib/Lib/Storage/Google.php - About 1 hr to fix

              Method doFind has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function doFind($script) {
                      $fullScript = $this->addExtension($script);
                      $themeDirectory = $this->theme->getDirectory();
                      $baseDirectory = $this->theme->getBaseDirectory();
                      $webRoot = '';
              Severity: Minor
              Found in lib/private/Template/JSResourceLocator.php - About 1 hr to fix

                Method file_put_contents has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function file_put_contents($path, $data) {
                        return $this->emittingCall(function () use (&$path, &$data) {
                            if (\is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier
                                $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
                                if (Filesystem::isValidPath($path)
                Severity: Minor
                Found in lib/private/Files/View.php - About 1 hr to fix

                  Method update has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function update($id, array $data) {
                          unset(self::$path_cache[(int)$id]);
                          if (isset($data['path'])) {
                              // normalize path
                              $data['path'] = $this->normalize($data['path']);
                  Severity: Minor
                  Found in lib/private/Files/Cache/Cache.php - About 1 hr to fix

                    Method scan has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function scan($dir = '') {
                            if (!Filesystem::isValidPath($dir)) {
                                throw new \InvalidArgumentException('Invalid path to scan');
                            }
                            $mounts = $this->getMounts($dir);
                    Severity: Minor
                    Found in lib/private/Files/Utils/Scanner.php - About 1 hr to fix

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

                          public function fopen($path, $mode) {
                              $path = $this->normalizePath($path);
                      
                              switch ($mode) {
                                  case 'r':
                      Severity: Minor
                      Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php - About 1 hr to fix

                        Method getMountsForUser has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getMountsForUser(IUser $user, IStorageFactory $loader) {
                                $mounts = [];
                        
                                // setUser is in UserTrait.
                                /* @phan-suppress-next-line PhanUndeclaredMethod */
                        Severity: Minor
                        Found in lib/private/Files/External/ConfigAdapter.php - About 1 hr to fix

                          Method handleChildren has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function handleChildren($path, $recursive, $reuse, $folderId, $lock, &$size) {
                                  // we put this in it's own function so it cleans up the memory before we start recursing
                                  $existingChildren = $this->getExistingChildren($folderId);
                                  $newChildren = $this->getNewChildren($path);
                          
                          
                          Severity: Minor
                          Found in lib/private/Files/Cache/Scanner.php - About 1 hr to fix

                            Method centerCrop has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function centerCrop($size = 0) {
                                    if (!$this->valid()) {
                                        $this->logger->error('OC_Image->centerCrop, No image loaded', ['app' => 'core']);
                                        return false;
                                    }
                            Severity: Minor
                            Found in lib/private/legacy/image.php - About 1 hr to fix

                              Method syncMultipleUsers has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function syncMultipleUsers(
                                      InputInterface $input,
                                      OutputInterface $output,
                                      SyncService $syncService,
                                      UserInterface $backend,
                              Severity: Minor
                              Found in core/Command/User/SyncBackend.php - About 1 hr to fix

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

                                    _.extend(OC.Files.Client, {
                                        PROPERTY_SHARE_TYPES:    '{' + OC.Files.Client.NS_OWNCLOUD + '}share-types',
                                        PROPERTY_OWNER_DISPLAY_NAME:    '{' + OC.Files.Client.NS_OWNCLOUD + '}owner-display-name'
                                    });
                                Severity: Major
                                Found in apps/files_sharing/js/share.js and 1 other location - About 1 hr to fix
                                apps/files/js/tagsplugin.js on lines 15..18

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

                                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

                                    _.extend(OC.Files.Client, {
                                        PROPERTY_TAGS:    '{' + OC.Files.Client.NS_OWNCLOUD + '}tags',
                                        PROPERTY_FAVORITE:    '{' + OC.Files.Client.NS_OWNCLOUD + '}favorite'
                                    });
                                Severity: Major
                                Found in apps/files/js/tagsplugin.js and 1 other location - About 1 hr to fix
                                apps/files_sharing/js/share.js on lines 13..16

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

                                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

                                                $(dialogId).find('.allnewfiles').on('click', function() {
                                                    var $checkboxes = $(dialogId).find('.conflict .replacement input[type="checkbox"]');
                                                    $checkboxes.prop('checked', $(this).prop('checked'));
                                                });
                                Severity: Major
                                Found in core/js/oc-dialogs.js and 1 other location - About 1 hr to fix
                                core/js/oc-dialogs.js on lines 639..642

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

                                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

                                                $(dialogId).find('.allexistingfiles').on('click', function() {
                                                    var $checkboxes = $(dialogId).find('.conflict .original:not(.readonly) input[type="checkbox"]');
                                                    $checkboxes.prop('checked', $(this).prop('checked'));
                                                });
                                Severity: Major
                                Found in core/js/oc-dialogs.js and 1 other location - About 1 hr to fix
                                core/js/oc-dialogs.js on lines 635..638

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

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

                                        _onClickDeleteSelected: 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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language