owncloud/core

View on GitHub

Showing 3,235 of 4,503 total issues

Method editUser has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function editUser($parameters) {
        /** @var string $targetUserId */
        $targetUserId = $parameters['userid'];

        // Check if user is logged in
Severity: Major
Found in apps/provisioning_api/lib/Users.php - About 3 hrs to fix

    File Installer.php has 315 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
     * @author Bart Visscher <bartv@thisnet.nl>
     * @author Brice Maron <brice@bmaron.net>
    Severity: Minor
    Found in lib/private/Installer.php - About 3 hrs to fix

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

          protected function execute(InputInterface $input, OutputInterface $output): int {
              $username = $input->getArgument('user');
              $emailLink = $input->getOption('send-email');
              $displayLink = $input->getOption('output-link');
      
      
      Severity: Major
      Found in core/Command/User/ResetPassword.php - About 3 hrs to fix

        UserList has 29 functions (exceeds 20 allowed). Consider refactoring.
        Open

        var UserList = {
            availableGroups: {},
            offset: 0,
            usersToLoad: 200,
            initialUsersToLoad: 200, // initial number of users to load
        Severity: Minor
        Found in settings/js/users/users.js - About 3 hrs to fix

          StorageConfig has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class StorageConfig implements IStorageConfig {
              /**
               * Storage config id
               *
               * @var int
          Severity: Minor
          Found in lib/private/Files/External/StorageConfig.php - About 3 hrs to fix

            Connection has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Connection extends \Doctrine\DBAL\Connection implements IDBConnection {
                /**
                 * @var string $tablePrefix
                 */
                protected $tablePrefix;
            Severity: Minor
            Found in lib/private/DB/Connection.php - About 3 hrs to fix

              Function createItem has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          function createItem(element, checked){
                              element=$(element);
                              var item=element.val();
                              var id='ms'+multiSelectId+'-option-'+item;
                              var input=$('<input type="' + inputType + '"/>');
              Severity: Major
              Found in core/js/multiselect.js - About 3 hrs to fix

                Method formatShare has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function formatShare(IShare $share, $received = false) {
                        $sharedBy = $this->userManager->get($share->getSharedBy());
                        $shareFileOwner = $this->userManager->get($share->getShareOwner());
                
                        $result = [
                Severity: Major
                Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 3 hrs to fix

                  Method copy has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function copy($path1, $path2, $preserveMtime = false) {
                          $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
                          $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
                          return $this->emittingCall(function () use ($absolutePath1, $absolutePath2) {
                              $result = false;
                  Severity: Major
                  Found in lib/private/Files/View.php - About 3 hrs to fix

                    Method analyse has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function analyse($appId) {
                            $appPath = $this->appManager->getAppPath($appId);
                            if ($appPath === false) {
                                throw new \RuntimeException("No app with given id <$appId> known.");
                            }
                    Severity: Major
                    Found in lib/private/App/CodeChecker/InfoChecker.php - About 3 hrs to fix

                      File Activity.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * @author Joas Schilling <coding@schilljs.com>
                       * @author Morris Jobke <hey@morrisjobke.de>
                       * @author Thomas Müller <thomas.mueller@tmit.eu>
                      Severity: Minor
                      Found in apps/files/lib/Activity.php - About 3 hrs to fix

                        Function add has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                        add: function(e, data) {
                                            self.log('add', e, data);
                                            var that = $(this), freeSpace;
                        
                                            var upload = new OC.FileUpload(self, data);
                        Severity: Major
                        Found in apps/files/js/file-upload.js - About 3 hrs to fix

                          Method get has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function get($dir, $files, $params = null) {
                                  $view = \OC\Files\Filesystem::getView();
                          
                                  if (!\is_array($files)) {
                                      // "files" contains a string with a filename
                          Severity: Major
                          Found in lib/private/legacy/files.php - About 3 hrs to fix

                            Function getNodeForPath has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getNodeForPath($path) {
                                    if (!$this->fileView) {
                                        throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
                                    }
                            
                            
                            Severity: Minor
                            Found in apps/dav/lib/Connector/Sabre/ObjectTree.php - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function rename has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function rename($source, $target) {
                                    $this->log("enter: rename('$source', '$target')", Util::DEBUG);
                            
                                    if ($this->isRootDir($source) || $this->isRootDir($target)) {
                                        $this->log("refusing to rename \"$source\" to \"$target\"");
                            Severity: Minor
                            Found in apps/files_external/lib/Lib/Storage/SMB.php - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function verify has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function verify($signaturePath, $basePath, $certificateCN, $force = false) {
                                    if (!$force && !$this->isCodeCheckEnforced()) {
                                        return [];
                                    }
                            
                            
                            Severity: Minor
                            Found in lib/private/IntegrityCheck/Checker.php - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function getIdsForTag has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getIdsForTag($tag) {
                                    $result = null;
                                    $tagId = false;
                                    if (\is_numeric($tag)) {
                                        $tagId = $tag;
                            Severity: Minor
                            Found in lib/private/Tags.php - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function fixOrientation has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function fixOrientation() {
                                    $o = $this->getOrientation();
                                    $this->logger->debug('OC_Image->fixOrientation() Orientation: ' . $o, ['app' => 'core']);
                                    $rotate = 0;
                                    $flip = false;
                            Severity: Minor
                            Found in lib/private/legacy/image.php - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function loadFromFile has a Cognitive Complexity of 24 (exceeds 5 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: Minor
                            Found in lib/private/legacy/image.php - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function gc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function gc() {
                                    $storage = $this->getStorage();
                                    if ($storage and $storage->is_dir('/')) {
                                        // extra hour safety, in case of stray part chunks that take longer to write,
                                        // because touch() is only called after the chunk was finished
                            Severity: Minor
                            Found in lib/private/Cache/File.php - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language