owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $uid = $input->getArgument('uid');
        if ($this->userManager->userExists($uid)) {
            $output->writeln('<error>The user "' . $uid . '" already exists.</error>');
            return 1;
Severity: Major
Found in core/Command/User/Add.php - About 2 hrs to fix

    SFTP has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SFTP extends \OCP\Files\Storage\StorageAdapter {
        private $host;
        private $user;
        private $root;
        private $port = 22;
    Severity: Minor
    Found in apps/files_external/lib/Lib/Storage/SFTP.php - About 2 hrs to fix

      NonExistingFolder has 25 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class NonExistingFolder extends Folder {
          /**
           * @param string $newPath
           * @throws \OCP\Files\NotFoundException
           */
      Severity: Minor
      Found in lib/private/Files/Node/NonExistingFolder.php - About 2 hrs to fix

        CacheWrapper has 25 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class CacheWrapper extends Cache {
            /**
             * @var \OCP\Files\Cache\ICache
             */
            protected $cache;
        Severity: Minor
        Found in lib/private/Files/Cache/Wrapper/CacheWrapper.php - About 2 hrs to fix

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

              private function extractPluginList($array) {
                  if (isset($array['sabre']) && \is_array($array['sabre'])) {
                      if (isset($array['sabre']['plugins']) && \is_array($array['sabre']['plugins'])) {
                          if (isset($array['sabre']['plugins']['plugin'])) {
                              $items = $array['sabre']['plugins']['plugin'];
          Severity: Major
          Found in apps/dav/lib/AppInfo/PluginManager.php and 1 other location - About 2 hrs to fix
          apps/dav/lib/AppInfo/PluginManager.php on lines 126..139

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

          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

                  if ($params[0] !== $params[1] && $params[1] !== null) {
                      $params[0] = $this->getUserString($params[0]);
                      $params[1] = $this->getUserString($params[1]);
                      $notification->setParsedSubject(
                          (string) $l->t('"%1$s" shared "%3$s" with you (on behalf of "%2$s")', $params)
          Severity: Major
          Found in apps/files_sharing/lib/Notifier.php and 1 other location - About 2 hrs to fix
          apps/files_sharing/lib/Notifier.php on lines 123..134

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

          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

                  if ($messageParams[0] !== $messageParams[1] && $messageParams[1] !== null) {
                      $messageParams[0] = $this->getUserString($messageParams[0]);
                      $messageParams[1] = $this->getUserString($messageParams[1]);
                      $notification->setParsedMessage(
                          (string) $l->t('"%1$s" invited you to view "%3$s" (on behalf of "%2$s")', $messageParams)
          Severity: Major
          Found in apps/files_sharing/lib/Notifier.php and 1 other location - About 2 hrs to fix
          apps/files_sharing/lib/Notifier.php on lines 109..120

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

          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

              private function extractCollectionList($array) {
                  if (isset($array['sabre']) && \is_array($array['sabre'])) {
                      if (isset($array['sabre']['collections']) && \is_array($array['sabre']['collections'])) {
                          if (isset($array['sabre']['collections']['collection'])) {
                              $items = $array['sabre']['collections']['collection'];
          Severity: Major
          Found in apps/dav/lib/AppInfo/PluginManager.php and 1 other location - About 2 hrs to fix
          apps/dav/lib/AppInfo/PluginManager.php on lines 111..124

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

          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 id.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          OC.L10N.register(
              "settings",
              {
              "Wrong current password" : "Sandi Anda salah",
              "The new password cannot be the same as the previous one" : "Sandi baru tidak boleh sama dengan sebelumnya",
          Severity: Minor
          Found in settings/l10n/id.js - About 2 hrs to fix

            File ast.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            OC.L10N.register(
                "settings",
                {
                "No user supplied" : "Nun s'especificó un usuariu",
                "Authentication error" : "Fallu d'autenticación",
            Severity: Minor
            Found in settings/l10n/ast.js - About 2 hrs to fix

              File SharedStorage.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * @author Bart Visscher <bartv@thisnet.nl>
               * @author Björn Schießle <bjoern@schiessle.org>
               * @author Joas Schilling <coding@schilljs.com>
              Severity: Minor
              Found in apps/files_sharing/lib/SharedStorage.php - About 2 hrs to fix

                File Manager.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                 * @author Bart Visscher <bartv@thisnet.nl>
                 * @author Bernhard Posselt <dev@bernhard-posselt.com>
                Severity: Minor
                Found in lib/private/Group/Manager.php - About 2 hrs to fix

                  Function _save has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _save: function () {
                              var deferred = $.Deferred();
                              var $el = this.$el;
                  
                              var $formElements       = $el.find('input, textarea, select, button'),
                  Severity: Major
                  Found in core/js/sharedialoglinkshareview.js - About 2 hrs to fix

                    Method mapperEvent has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function mapperEvent(MapperEvent $event) {
                            $tagIds = $event->getTags();
                            if ($event->getObjectType() !== 'files' ||empty($tagIds)
                                || !\in_array($event->getEvent(), [MapperEvent::EVENT_ASSIGN, MapperEvent::EVENT_UNASSIGN])
                                || !$this->appManager->isInstalled('activity')) {
                    Severity: Major
                    Found in apps/systemtags/lib/Activity/Listener.php - About 2 hrs to fix

                      Method updateHtaccess has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function updateHtaccess() {
                              $config = \OC::$server->getConfig();
                              $il10n = \OC::$server->getL10N('lib');
                      
                              // For CLI read the value from overwrite.cli.url
                      Severity: Major
                      Found in lib/private/Setup.php - About 2 hrs to fix

                        Method match has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function match($url) {
                                if (\substr($url, 0, 6) === '/apps/') {
                                    // empty string / 'apps' / $app / rest of the route
                                    list(, , $app, ) = \explode('/', $url, 4);
                        
                        
                        Severity: Major
                        Found in lib/private/Route/Router.php - About 2 hrs to fix

                          File Apps.php has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * @author Viktar Dubiniuk <dubiniuk@owncloud.com>
                           *
                           * @copyright Copyright (c) 2018, ownCloud GmbH
                          Severity: Minor
                          Found in lib/private/Repair/Apps.php - About 2 hrs to fix

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

                            <?php
                            
                            namespace OCA\Files_Trashbin\Migrations;
                            
                            use Doctrine\DBAL\Schema\Schema;
                            apps/federatedfilesharing/appinfo/Migrations/Version20190410160725.php on lines 1..42
                            apps/files_sharing/appinfo/Migrations/Version20190426123324.php on lines 1..41

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

                            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

                            <?php
                            /**
                             * @author Viktar Dubiniuk <dubiniuk@owncloud.com>
                             *
                             * @copyright Copyright (c) 2019, ownCloud GmbH
                            apps/files_sharing/appinfo/Migrations/Version20190426123324.php on lines 1..41
                            apps/files_trashbin/appinfo/Migrations/Version20170804201253.php on lines 1..24

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

                            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

                            <?php
                            /**
                             * @author Viktar Dubiniuk <dubiniuk@owncloud.com>
                             *
                             * @copyright Copyright (c) 2019, ownCloud GmbH
                            apps/federatedfilesharing/appinfo/Migrations/Version20190410160725.php on lines 1..42
                            apps/files_trashbin/appinfo/Migrations/Version20170804201253.php on lines 1..24

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

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language