owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method verifyChecksumsForFile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function verifyChecksumsForFile($file, InputInterface $input, OutputInterface $output) {
        $path = $file->getInternalPath();
        $currentChecksums = $file->getChecksum();
        $storage = $file->getStorage();
        $storageId = $storage->getId();
Severity: Minor
Found in apps/files/lib/Command/VerifyChecksums.php - About 1 hr to fix

    Method searchCommon has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function searchCommon($method, $args) {
            $files = [];
            $rootLength = \strlen($this->path);
            $mount = $this->root->getMount($this->path);
            $storage = $mount->getStorage();
    Severity: Minor
    Found in lib/private/Files/Node/Folder.php - About 1 hr to fix

      Method searchCommon has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function searchCommon($method, $args) {
              $files = [];
              $rootLength = \strlen($this->fakeRoot);
      
              $mount = $this->getMount('');
      Severity: Minor
      Found in lib/private/Files/View.php - About 1 hr to fix

        Method writeBack has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function writeBack($tmpFile) {
                if (!isset(self::$tmpFiles[$tmpFile])) {
                    return;
                }
        
        
        Severity: Minor
        Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php - About 1 hr to fix

          Method generatePreview has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function generatePreview() {
                  $file = $this->getFile();
                  $preview = null;
          
                  $previewProviders = \OC::$server->getPreviewManager()
          Severity: Minor
          Found in lib/private/Preview.php - About 1 hr to fix

            Method xmlToArray has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function xmlToArray($xml) {
                    if (!$xml->children()) {
                        return (string)$xml;
                    }
            
            
            Severity: Minor
            Found in lib/private/App/InfoParser.php - About 1 hr to fix

              Method getAppInfoByPath has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getAppInfoByPath($path, $etag = null) {
                      $file = \realpath($path);
              
                      // check the cache
                      $data = $this->appInfo->get($file);
              Severity: Minor
              Found in lib/private/App/AppManager.php - About 1 hr to fix

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

                    protected function execute(InputInterface $input, OutputInterface $output): int {
                        $groupName = $input->getArgument('group');
                        $group = $this->groupManager->get($groupName);
                        $errorFound = false;
                        if (!$group) {
                Severity: Minor
                Found in core/Command/Group/AddMember.php - About 1 hr to fix

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

                      protected function execute(InputInterface $input, OutputInterface $output): int {
                          $groupName = $input->getArgument('group');
                          $group = $this->groupManager->get($groupName);
                          $errorFound = false;
                          if (!$group) {
                  Severity: Minor
                  Found in core/Command/Group/RemoveMember.php - About 1 hr to fix

                    Method postCroppedAvatar has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function postCroppedAvatar($crop) {
                            $userId = $this->userSession->getUser()->getUID();
                    
                            if ($crop === null) {
                                return new DataResponse(
                    Severity: Minor
                    Found in core/Controller/AvatarController.php - About 1 hr to fix

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

                          public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) {
                              // set ownCloud namespace
                              $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
                      
                              // adding the retry node
                      Severity: Major
                      Found in apps/dav/lib/Connector/Sabre/Exception/Forbidden.php and 1 other location - About 1 hr to fix
                      apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php on lines 60..71

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

                      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

                          public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) {
                              // set ownCloud namespace
                              $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
                      
                              // adding the retry node
                      Severity: Major
                      Found in apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php and 1 other location - About 1 hr to fix
                      apps/dav/lib/Connector/Sabre/Exception/Forbidden.php on lines 50..61

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

                      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 addSharedSecret($url, $sharedSecret) {
                              $hash = $this->hash($url);
                              $query = $this->connection->getQueryBuilder();
                              $query->update($this->dbTable)
                                  ->set('shared_secret', $query->createParameter('sharedSecret'))
                      Severity: Major
                      Found in apps/federation/lib/DbHandler.php and 1 other location - About 1 hr to fix
                      apps/federation/lib/DbHandler.php on lines 162..171

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

                      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 addToken($url, $token) {
                              $hash = $this->hash($url);
                              $query = $this->connection->getQueryBuilder();
                              $query->update($this->dbTable)
                                  ->set('token', $query->createParameter('token'))
                      Severity: Major
                      Found in apps/federation/lib/DbHandler.php and 1 other location - About 1 hr to fix
                      apps/federation/lib/DbHandler.php on lines 202..211

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

                      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

                      Method __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              $appName,
                              IRequest $request,
                              IGroupManager $groupManager,
                              IUserManager $userManager,
                              IManager $contactsManager,
                      Severity: Major
                      Found in apps/files_sharing/lib/Controller/ShareesController.php - About 1 hr to fix

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

                                if ( options.my[ 0 ] === "right" ) {
                                    position.left -= elemWidth;
                                } else if ( options.my[ 0 ] === "center" ) {
                                    position.left -= elemWidth / 2;
                                }
                        Severity: Major
                        Found in core/js/js.js and 3 other locations - About 1 hr to fix
                        core/js/js.js on lines 2729..2733
                        core/js/js.js on lines 2735..2739
                        core/js/js.js on lines 2765..2769

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

                        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 4 locations. Consider refactoring.
                        Open

                            if ( options.at[ 0 ] === "right" ) {
                                basePosition.left += targetWidth;
                            } else if ( options.at[ 0 ] === "center" ) {
                                basePosition.left += targetWidth / 2;
                            }
                        Severity: Major
                        Found in core/js/js.js and 3 other locations - About 1 hr to fix
                        core/js/js.js on lines 2735..2739
                        core/js/js.js on lines 2759..2763
                        core/js/js.js on lines 2765..2769

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

                        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 4 locations. Consider refactoring.
                        Open

                                if ( options.my[ 1 ] === "bottom" ) {
                                    position.top -= elemHeight;
                                } else if ( options.my[ 1 ] === "center" ) {
                                    position.top -= elemHeight / 2;
                                }
                        Severity: Major
                        Found in core/js/js.js and 3 other locations - About 1 hr to fix
                        core/js/js.js on lines 2729..2733
                        core/js/js.js on lines 2735..2739
                        core/js/js.js on lines 2759..2763

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

                        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 4 locations. Consider refactoring.
                        Open

                            if ( options.at[ 1 ] === "bottom" ) {
                                basePosition.top += targetHeight;
                            } else if ( options.at[ 1 ] === "center" ) {
                                basePosition.top += targetHeight / 2;
                            }
                        Severity: Major
                        Found in core/js/js.js and 3 other locations - About 1 hr to fix
                        core/js/js.js on lines 2729..2733
                        core/js/js.js on lines 2759..2763
                        core/js/js.js on lines 2765..2769

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

                        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

                            function newFolder() {
                                $("#new").addClass("active");
                                $(".popup.popupTop").toggle(true);
                                $('#new li[data-type="folder"]').trigger('click');
                                removeA(keys, keyCodes.n);
                        Severity: Major
                        Found in apps/files/js/keyboardshortcuts.js and 1 other location - About 1 hr to fix
                        apps/files/js/keyboardshortcuts.js on lines 45..50

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

                        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