owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method validateExpireDate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function validateExpireDate($expireDate, $shareTime, $itemType, $itemSource) {
        $l = \OC::$server->getL10N('lib');
        $date = new \DateTime($expireDate);
        $today = new \DateTime('now');

Severity: Minor
Found in lib/private/Share/Share.php - About 1 hr to fix

    Method processSimpleRoutes has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function processSimpleRoutes($routes) {
            $simpleRoutes = isset($routes['routes']) ? $routes['routes'] : [];
            foreach ($simpleRoutes as $simpleRoute) {
                $name = $simpleRoute['name'];
                $postfix = '';
    Severity: Minor
    Found in lib/private/AppFramework/Routing/RouteConfig.php - About 1 hr to fix

      Method isCached has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function isCached() {
              $fileId = $this->getFile()->getId();
              if ($fileId === null) {
                  return false;
              }
      Severity: Minor
      Found in lib/private/Preview.php - About 1 hr to fix

        Method isAppCompatible has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function isAppCompatible($ocVersion, $appInfo) {
                $requireMin = '';
                $requireMax = '';
                if (isset($appInfo['dependencies']['owncloud']['@attributes']['min-version'])) {
                    $requireMin = $appInfo['dependencies']['owncloud']['@attributes']['min-version'];
        Severity: Minor
        Found in lib/private/legacy/app.php - About 1 hr to fix

          Method getShippedApps has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected static function getShippedApps() {
                  $shippedApps = [];
                  foreach (\OC::$APPSROOTS as $app_dir) {
                      if ($dir = \opendir($app_dir['path'])) {
                          $nodes = \scandir($app_dir['path']);
          Severity: Minor
          Found in lib/private/Installer.php - About 1 hr to fix

            Method useBackend has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function useBackend($backend = 'database') {
                    if ($backend instanceof \OCP\UserInterface) {
                        self::$_usedBackends[\get_class($backend)] = $backend;
                        \OC::$server->getUserManager()->registerBackend($backend);
                    } else {
            Severity: Minor
            Found in lib/private/legacy/user.php - About 1 hr to fix

              Method getUidAndFilename has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getUidAndFilename($path) {
                      list($storage, $internalPath) = $this->rootView->resolvePath($path);
              
                      $absMountPoint = $this->rootView->getMountPoint($path);
                      $parts = \explode('/', $absMountPoint);
              Severity: Minor
              Found in lib/private/Encryption/Util.php - About 1 hr to fix

                Method set has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function set($data) {
                        if ($data instanceof IImage) {
                            $img = $data;
                            $data = $img->data();
                        } else {
                Severity: Minor
                Found in lib/private/Avatar.php - About 1 hr to fix

                  Method getForObject has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getForObject(
                          $objectType,
                          $objectId,
                          $limit = 0,
                          $offset = 0,
                  Severity: Minor
                  Found in lib/private/Comments/Manager.php - About 1 hr to fix

                    Method convertDB has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function convertDB(Connection $fromDB, Connection $toDB, array $tables, InputInterface $input, OutputInterface $output) {
                            $this->config->setSystemValue('maintenance', true);
                            try {
                                $fromSchema = $fromDB->createSchema();
                                // copy table rows
                    Severity: Minor
                    Found in core/Command/Db/ConvertType.php - About 1 hr to fix

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

                          protected function execute(InputInterface $input, OutputInterface $output): int {
                              $privateKeyPath = $input->getOption('privateKey');
                              $keyBundlePath = $input->getOption('certificate');
                              $path = $input->getOption('path');
                              if ($privateKeyPath === null || $keyBundlePath === null || $path === null) {
                      Severity: Minor
                      Found in core/Command/Integrity/SignCore.php - About 1 hr to fix

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

                            protected function execute(InputInterface $input, OutputInterface $output): int {
                                if (!$this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
                                    $output->writeln("<error>This command is only valid for MySQL/MariaDB databases.</error>");
                                    return 1;
                                }
                        Severity: Minor
                        Found in core/Command/Db/RestoreDefaultRowFormat.php - About 1 hr to fix

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

                              protected function execute(InputInterface $input, OutputInterface $output): int {
                                  $importFile = $input->getArgument('file');
                                  if ($importFile !== null) {
                                      $content = $this->getArrayFromFile($importFile);
                                  } else {
                          Severity: Minor
                          Found in core/Command/Config/Import.php - About 1 hr to fix

                            Method checkInput has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function checkInput(InputInterface $input) {
                                    $uid = $input->getArgument('uid');
                                    if (!$input->getOption('ignore-missing-user') && !$this->userManager->userExists($uid)) {
                                        throw new \InvalidArgumentException('The user "' . $uid . '" does not exist.');
                                    }
                            Severity: Minor
                            Found in core/Command/User/Setting.php - About 1 hr to fix

                              Method showChallenge has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function showChallenge($challengeProviderId, $redirect_url) {
                                      $user = $this->userSession->getUser();
                                      $provider = $this->twoFactorManager->getProvider($user, $challengeProviderId);
                                      if ($provider === null) {
                                          return new RedirectResponse($this->urlGenerator->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
                              Severity: Minor
                              Found in core/Controller/TwoFactorChallengeController.php - About 1 hr to fix

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

                                        url: function() {
                                            return OC.linkToRemote('dav') + '/comments/' +
                                                encodeURIComponent(this._objectType) + '/' +
                                                encodeURIComponent(this.id) + '/';
                                        }
                                Severity: Major
                                Found in apps/comments/js/commentsummarymodel.js and 1 other location - About 1 hr to fix
                                apps/comments/js/commentcollection.js on lines 71..75

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

                                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 (file.type === 'dir' || file.mime === 'httpd/unix-directory') {
                                                this.summary.totalDirs++;
                                            }
                                            else {
                                                this.summary.totalFiles++;
                                Severity: Major
                                Found in apps/files/js/filesummary.js and 1 other location - About 1 hr to fix
                                apps/files/js/filesummary.js on lines 119..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 57.

                                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

                                        } else {
                                            if ($.trim(email) === '') {
                                                OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', {
                                                    message: t('settings', 'A valid email must be provided')
                                                }));
                                Severity: Major
                                Found in settings/js/users/users.js and 1 other location - About 1 hr to fix
                                settings/js/users/users.js on lines 941..948

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

                                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

                                        enableActions: function() {
                                            this.$el.find('.action').css('display', 'inline');
                                            this.$el.find('input:checkbox').removeClass('u-hidden');
                                        },
                                Severity: Major
                                Found in apps/files_trashbin/js/filelist.js and 1 other location - About 1 hr to fix
                                apps/files_trashbin/js/filelist.js on lines 291..294

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

                                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 (file.type === 'dir' || file.mime === 'httpd/unix-directory') {
                                                this.summary.totalDirs--;
                                            }
                                            else {
                                                this.summary.totalFiles--;
                                Severity: Major
                                Found in apps/files/js/filesummary.js and 1 other location - About 1 hr to fix
                                apps/files/js/filesummary.js on lines 90..95

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

                                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