owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method create has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create(
        $mountPoint,
        $backend,
        $authMechanism,
        $backendOptions,
Severity: Minor
Found in apps/files_external/lib/Controller/UserStoragesController.php - About 1 hr to fix

    Method findUsersInGroup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function findUsersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
            $group = $this->get($gid);
            if ($group === null) {
                return [];
            }
    Severity: Minor
    Found in lib/private/Group/Manager.php - About 1 hr to fix

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

          public function rename($path1, $path2) {
              $srcParent = \dirname($path1);
              $dstParent = \dirname($path2);
      
              if (!$this->isUpdatable($srcParent)) {
      Severity: Minor
      Found in lib/private/Files/Storage/Local.php - About 1 hr to fix

        Method displayNamesInGroup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
                $group = $this->get($gid);
                if ($group === null) {
                    return [];
                }
        Severity: Minor
        Found in lib/private/Group/Manager.php - About 1 hr to fix

          Method mimeTypeIcon has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function mimeTypeIcon($mimetype) {
                  $this->loadAliases();
          
                  while (isset($this->mimeTypeAlias[$mimetype])) {
                      $mimetype = $this->mimeTypeAlias[$mimetype];
          Severity: Minor
          Found in lib/private/Files/Type/Detection.php - About 1 hr to fix

            Method registerBackend has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
                    if (self::isEnabled()) {
                        if (!isset(self::$backendTypes[$itemType])) {
                            self::$backendTypes[$itemType] = [
                                'class' => $class,
            Severity: Minor
            Found in lib/private/Share/Share.php - About 1 hr to fix

              Method resolveGroupShares has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function resolveGroupShares($shares, $userId) {
                      $qb = $this->dbConn->getQueryBuilder();
              
                      list($chunkedShareIds, $shareIdToShareMap) = $this->chunkSharesToMaps($shares);
                      foreach ($chunkedShareIds as $shareIdsChunk) {
              Severity: Minor
              Found in lib/private/Share20/DefaultShareProvider.php - About 1 hr to fix

                Method executeAudited has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function executeAudited($stmt, array $parameters = null) {
                        if (\is_string($stmt)) {
                            // convert to an array with 'sql'
                            if (\stripos($stmt, 'LIMIT') !== false) { //OFFSET requires LIMIT, so we only need to check for LIMIT
                                // TODO try to convert LIMIT OFFSET notation to parameters
                Severity: Minor
                Found in lib/private/legacy/db.php - About 1 hr to fix

                  Method removeListener has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function removeListener($scope = null, $method = null, callable $callback = null) {
                          $names = [];
                          $allNames = \array_keys($this->listeners);
                          if ($scope and $method) {
                              $name = $scope . '::' . $method;
                  Severity: Minor
                  Found in lib/private/Hooks/EmitterTrait.php - About 1 hr to fix

                    Method getNormalizedLanguages has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getNormalizedLanguages(IFactory $langFactory, $activeLangCode) {
                            $userLang = null;
                            $commonLanguages = [];
                            $languages = [];
                    
                    
                    Severity: Minor
                    Found in lib/private/Helper/LocaleHelper.php - About 1 hr to fix

                      Method delete has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function delete(): bool {
                              if ($this->emitter) {
                                  $this->emitter->emit('\OC\User', 'preDelete', [$this]);
                              }
                              // get the home now because it won't return it after user deletion
                      Severity: Minor
                      Found in lib/private/User/User.php - About 1 hr to fix

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

                            protected function execute(InputInterface $input, OutputInterface $output): int {
                                if (!$input->getOption('accept-warning')) {
                                    $helper = new QuestionHelper();
                                    $q = <<<EOS
                        <question>This command is for maintenance and support purposes. 
                        Severity: Minor
                        Found in core/Command/Background/Queue/Execute.php - About 1 hr to fix

                          Method configure has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function configure() {
                                  parent::configure();
                          
                                  $this
                                      ->setName('app:list')
                          Severity: Minor
                          Found in core/Command/App/ListApps.php - About 1 hr to fix

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

                                        if(!_.isUndefined(options.itemModel)) {
                                            this.itemModel = options.itemModel;
                                            this.configModel = this.itemModel.configModel;
                                        } else {
                                            throw 'missing OC.Share.ShareItemModel';
                            Severity: Major
                            Found in core/js/sharedialoglinkexpirationview.js and 1 other location - About 1 hr to fix
                            core/js/sharedialoglinkshareview.js on lines 92..97

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

                            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 (!_.isUndefined(options.itemModel)) {
                                            this.itemModel = options.itemModel;
                                            this.configModel = this.itemModel.configModel;
                                        } else {
                                            throw 'missing OC.Share.ShareItemModel';
                            Severity: Major
                            Found in core/js/sharedialoglinkshareview.js and 1 other location - About 1 hr to fix
                            core/js/sharedialoglinkexpirationview.js on lines 58..63

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

                            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 ($this->server->tree->nodeExists($destination)) {
                                        $targetNode = $this->server->tree->getNodeForPath($destination);
                                        if ($targetNode instanceof Node) {
                                            $destinationSize = $targetNode->getSize() ?? 0;
                                        }
                            Severity: Major
                            Found in apps/dav/lib/Connector/Sabre/QuotaPlugin.php and 1 other location - About 1 hr to fix
                            apps/dav/lib/Connector/Sabre/QuotaPlugin.php on lines 94..103

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

                            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

                                        $qb->update('share')
                                            ->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())))
                                            ->set('share_with', $qb->createNamedParameter($share->getPassword()))
                                            ->set('uid_owner', $qb->createNamedParameter($share->getShareOwner()))
                                            ->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy()))
                            Severity: Major
                            Found in lib/private/Share20/DefaultShareProvider.php and 1 other location - About 1 hr to fix
                            lib/private/Share20/DefaultShareProvider.php on lines 219..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 107.

                            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 ($this->server->tree->nodeExists($destination)) {
                                        $targetNode = $this->server->tree->getNodeForPath($destination);
                                        if ($targetNode instanceof Node) {
                                            $destinationSize = $targetNode->getSize() ?? 0;
                                        }
                            Severity: Major
                            Found in apps/dav/lib/Connector/Sabre/QuotaPlugin.php and 1 other location - About 1 hr to fix
                            apps/dav/lib/Connector/Sabre/QuotaPlugin.php on lines 131..140

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

                            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

                                        $qb->update('share')
                                            ->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())))
                                            ->set('share_with', $qb->createNamedParameter($share->getSharedWith()))
                                            ->set('uid_owner', $qb->createNamedParameter($share->getShareOwner()))
                                            ->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy()))
                            Severity: Major
                            Found in lib/private/Share20/DefaultShareProvider.php and 1 other location - About 1 hr to fix
                            lib/private/Share20/DefaultShareProvider.php on lines 273..279

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

                            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(
                                    IUserManager $userManager,
                                    IManager $shareManager,
                                    IMountManager $mountManager,
                                    IRootFolder $rootFolder,
                            Severity: Major
                            Found in apps/files/lib/Command/TransferOwnership.php and 1 other location - About 1 hr to fix
                            apps/files/lib/Command/Scan.php on lines 72..87

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

                            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