owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Function copy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function copy($source, $destination) {
        if (!$this->fileView) {
            throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
        }

Severity: Minor
Found in apps/dav/lib/Connector/Sabre/ObjectTree.php - About 45 mins 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

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

        $objectType,
        ISystemTagManager $tagManager,
        ISystemTagObjectMapper $tagMapper,
        IUserSession $userSession,
        IGroupManager $groupManager,
Severity: Minor
Found in apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php - About 45 mins to fix

    Method sendUpdateToRemote has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function sendUpdateToRemote($remote, $remoteId, $token, $action, $data = [], $try = 0) {
    Severity: Minor
    Found in apps/federatedfilesharing/lib/Notifications.php - About 45 mins to fix

      Method getSharesBy has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset) {
      Severity: Minor
      Found in apps/federatedfilesharing/lib/FederatedShareProvider.php - About 45 mins to fix

        Function createCalendar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function createCalendar($principalUri, $calendarUri, array $properties) {
                $principalUri = $this->convertPrincipal($principalUri, true);
                $values = [
                    'principaluri' => $principalUri,
                    'uri'          => $calendarUri,
        Severity: Minor
        Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 45 mins 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

        Method addShare has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function addShare($remote, $token, $name, $owner, $shareWith, $remoteId) {
        Severity: Minor
        Found in apps/federatedfilesharing/lib/FederatedShareProvider.php - About 45 mins to fix

          Function createSubscription has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function createSubscription($principalUri, $uri, array $properties) {
                  if (!isset($properties['{http://calendarserver.org/ns/}source'])) {
                      throw new Forbidden('The {http://calendarserver.org/ns/}source property is required when creating subscriptions');
                  }
          
          
          Severity: Minor
          Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 45 mins 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

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

              public function __construct(IConfig $config, IManager $notificationManager, IGroupManager $groupManager, IAppManager $appManager, IClientService $client, IURLGenerator $urlGenerator) {
          Severity: Minor
          Found in apps/updatenotification/lib/Notification/BackgroundJob.php - About 45 mins to fix

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

                    IUserManager $userManager,
                    IGroupManager $groupManager,
                    IUserSession $userSession,
                    ILogger $logger,
                    IConfig $config,
            Severity: Minor
            Found in apps/provisioning_api/lib/Users.php - About 45 mins to fix

              Method sendRemoteShare has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      Address $shareWithAddress,
                      Address $ownerAddress,
                      Address $sharedByAddress,
                      $token,
                      $name,
              Severity: Minor
              Found in apps/federatedfilesharing/lib/Notifications.php - About 45 mins to fix

                Method sendPreOcmRemoteShare has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    protected function sendPreOcmRemoteShare(Address $shareWithAddress, Address $ownerAddress, Address $sharedByAddress, $token, $name, $remote_id) {
                Severity: Minor
                Found in apps/federatedfilesharing/lib/Notifications.php - About 45 mins to fix

                  Function emitPreHooks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function emitPreHooks($exists, $path = null) {
                          if ($path === null) {
                              $path = $this->path;
                          }
                          $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path));
                  Severity: Minor
                  Found in apps/dav/lib/Connector/Sabre/File.php - About 45 mins 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 getLock has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getLock(RequestInterface $request) {
                          // we can't listen on 'beforeMethod:PUT' due to order of operations with setting up the tree
                          // so instead we limit ourselves to the PUT method manually
                          if ($request->getMethod() !== 'PUT' || \OC_FileChunking::isWebdavChunk()) {
                              return;
                  Severity: Minor
                  Found in apps/dav/lib/Connector/Sabre/LockPlugin.php - About 45 mins 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 stream_read has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function stream_read($count) {
                          $node = null;
                          $lastNode = null;
                          do {
                              if ($this->currentStream === null) {
                  Severity: Minor
                  Found in apps/dav/lib/Upload/AssemblyStream.php - About 45 mins 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 getPhoto has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getPhoto(Card $node) {
                          // TODO: this is kind of expensive - load carddav data from database and parse it
                          //       we might want to build up a cache one day
                          try {
                              $vObject = $this->readCard($node->get());
                  Severity: Minor
                  Found in apps/dav/lib/CardDAV/ImageExportPlugin.php - About 45 mins 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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function execute(InputInterface $input, OutputInterface $output): int {
                          $authBackends = $this->backendService->getAuthMechanisms();
                          $storageBackends = $this->backendService->getBackends();
                  
                          $data = [
                  Severity: Minor
                  Found in apps/files_external/lib/Command/Backends.php - About 45 mins 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 validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function validate(IStorageConfig $storage) {
                          $mountPoint = $storage->getMountPoint();
                          if ($mountPoint === '' || $mountPoint === '/') {
                              return new DataResponse(
                                  [
                  Severity: Minor
                  Found in apps/files_external/lib/Controller/StoragesController.php - About 45 mins 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

                  Method searchEx has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function searchEx($addressBookId, $pattern, $searchProperties, $options, $limit = 100, $offset = 0) {
                  Severity: Minor
                  Found in apps/dav/lib/CardDAV/CardDavBackend.php - About 45 mins to fix

                    Function delete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function delete($path) {
                            $moveSource = $this->moveSource;
                            $this->moveSource = null;
                    
                            if ($moveSource === $path) {
                    Severity: Minor
                    Found in apps/dav/lib/DAV/FileCustomPropertiesBackend.php - About 45 mins 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 loadChildrenProperties has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function loadChildrenProperties(INode $node, $requestedProperties) {
                            // note: pre-fetching only supported for depth <= 1
                            if (!($node instanceof Directory)) {
                                return;
                            }
                    Severity: Minor
                    Found in apps/dav/lib/DAV/FileCustomPropertiesBackend.php - About 45 mins 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