owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

        try {
            \OC\Files\Filesystem::initMountPoints($userId);

            /** @var File $oldAvatarFile */
            $oldAvatarFile = null;
Severity: Major
Found in lib/private/Repair/MoveAvatarOutsideHome.php and 1 other location - About 2 hrs to fix
lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 110..158

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

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

        _createRow: function(fileData) {
            // TODO: hook earlier and render the whole row here
            var $tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments);
            var td;
            var formatted;
Severity: Major
Found in apps/files_sharing/js/sharedfilelist.js - About 2 hrs to fix

    File ca.js has 280 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    OC.L10N.register(
        "core",
        {
        "Please select a file." : "Si us plau, selecciona un fitxer",
        "File is too big" : "El fitxer és massa gran",
    Severity: Minor
    Found in core/l10n/ca.js - About 2 hrs to fix

      Method getDenormalizedData has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getDenormalizedData($calendarData) {
              $vObject = Reader::read($calendarData);
              $componentType = null;
              $component = null;
              $firstOccurrence = null;
      Severity: Major
      Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 2 hrs to fix

        Method propFind has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function propFind(PropFind $propFind, INode $node) {
                // properties about the share
                if ($node instanceof PublicSharedRootNode) {
                    $propFind->handle(self::PUBLIC_LINK_ITEM_TYPE, static function () use ($node) {
                        return $node->getShare()->getNodeType();
        Severity: Major
        Found in apps/dav/lib/Files/PublicFiles/PublicFilesPlugin.php - About 2 hrs to fix

          File ListCommand.php has 280 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * @author Robin Appelman <icewind@owncloud.com>
           * @author Vincent Petry <pvince81@owncloud.com>
           *
          Severity: Minor
          Found in apps/files_external/lib/Command/ListCommand.php - About 2 hrs to fix

            Method getDiff has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) {
                    $schemaDiff = parent::getDiff($targetSchema, $connection);
            
                    // oracle forces us to quote the identifiers
                    $schemaDiff->newTables = \array_map(function (Table $table) {
            Severity: Major
            Found in lib/private/DB/OracleMigrator.php - About 2 hrs to fix

              File profile.js has 279 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * Post the email address change to the server.
               */
              function changeEmailAddress () {
                  var emailInfo = $('#email');
              Severity: Minor
              Found in settings/js/panels/profile.js - About 2 hrs to fix

                Function _onClickFile has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _onClickFile: function(event) {
                            this._setCurrentRow($(event.currentTarget).closest('tr'));
                
                            var $link = $(event.target).closest('a');
                            if ($link.attr('href') === '#' || $link.hasClass('disable-click')) {
                Severity: Major
                Found in apps/files/js/filelist.js - About 2 hrs to fix

                  Method move2trash has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function move2trash($file_path) {
                          // get the user for which the filesystem is setup
                          $root = Filesystem::getRoot();
                          list(, $user) = \explode('/', $root);
                          list($owner, $ownerPath) = self::getUidAndFilename($file_path);
                  Severity: Major
                  Found in apps/files_trashbin/lib/Trashbin.php - About 2 hrs to fix

                    Method getSpecialParameterList has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getSpecialParameterList($app, $text) {
                            if ($app === self::APP_FILES) {
                                switch ($text) {
                                    case 'created_self':
                                        return [
                    Severity: Major
                    Found in apps/files/lib/Activity.php - About 2 hrs to fix

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

                          public function update(\OCP\Share\IShare $share) {
                              $this->validate($share);
                      
                              $shareAttributes = $this->formatShareAttributes(
                                  $share->getAttributes()
                      Severity: Major
                      Found in lib/private/Share20/DefaultShareProvider.php - About 2 hrs to fix

                        Method initialize has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function initialize() {
                                $loadedExtensions = \get_loaded_extensions();
                                $packages = [];
                        
                                // Extensions scanning
                        Severity: Major
                        Found in lib/private/App/PlatformRepository.php - About 2 hrs to fix

                          Method loadFromFile has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function loadFromFile($imagePath = false) {
                                  // exif_imagetype throws "read error!" if file is less than 12 byte
                                  if (!@\is_file($imagePath) || !\file_exists($imagePath) || \filesize($imagePath) < 12 || !\is_readable($imagePath)) {
                                      return false;
                                  }
                          Severity: Major
                          Found in lib/private/legacy/image.php - About 2 hrs to fix

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

                                protected function execute(InputInterface $input, OutputInterface $output): int {
                                    $userNameSubString = $input->getArgument('search-pattern');
                                    $attributes = \array_map('mb_strtolower', $input->getOption('attributes'));
                                    $showAllAttributes = $input->getOption('show-all-attributes');
                                    $useKey = \count($attributes) > 1
                            Severity: Major
                            Found in core/Command/User/ListUsers.php - About 2 hrs to fix

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

                                  public function __construct(IL10N $l) {
                                      $this
                                          ->setIdentifier('owncloud')
                                          ->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat
                                          ->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
                              Severity: Major
                              Found in apps/files_external/lib/Lib/Backend/OwnCloud.php and 1 other location - About 2 hrs to fix
                              apps/files_external/lib/Lib/Backend/DAV.php on lines 34..49

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

                              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 delete() {
                                      if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
                                          $principal = 'principal:' . parent::getOwner();
                                          $shares = $this->getShares();
                                          $shares = \array_filter($shares, function ($share) use ($principal) {
                              Severity: Major
                              Found in apps/dav/lib/CalDAV/Calendar.php and 1 other location - About 2 hrs to fix
                              apps/dav/lib/CardDAV/AddressBook.php on lines 141..161

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

                              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 delete() {
                                      if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
                                          $principal = 'principal:' . parent::getOwner();
                                          $shares = $this->getShares();
                                          $shares = \array_filter($shares, function ($share) use ($principal) {
                              Severity: Major
                              Found in apps/dav/lib/CardDAV/AddressBook.php and 1 other location - About 2 hrs to fix
                              apps/dav/lib/CalDAV/Calendar.php on lines 159..179

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

                              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 __construct(IL10N $l) {
                                      $this
                                          ->setIdentifier('dav')
                                          ->addIdentifierAlias('\OC\Files\Storage\DAV') // legacy compat
                                          ->setStorageClass('\OC\Files\Storage\DAV')
                              Severity: Major
                              Found in apps/files_external/lib/Lib/Backend/DAV.php and 1 other location - About 2 hrs to fix
                              apps/files_external/lib/Lib/Backend/OwnCloud.php on lines 31..46

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

                              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

                              File de_AT.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              OC.L10N.register(
                                  "core",
                                  {
                                  "Please select a file." : "Bitte wähle eine Datei aus.",
                                  "File is too big" : "Datei ist zu groß",
                              Severity: Minor
                              Found in core/l10n/de_AT.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language