owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

    private function createComment($objectType, $objectId, $data, $contentType = 'application/json') {
        if (\explode(';', $contentType)[0] === 'application/json') {
            $data = \json_decode($data, true);
        } else {
            throw new UnsupportedMediaType();
Severity: Minor
Found in apps/comments/lib/Dav/CommentsPlugin.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 createShare has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        Address $ownerAddress,
        Address $sharedByAddress,
        $shareWith,
        $remoteId,
        $name,
Severity: Minor
Found in apps/federatedfilesharing/lib/FedShareManager.php - About 45 mins to fix

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

            $appName,
            IRequest $request,
            OcmMiddleware $ocmMiddleware,
            IUserManager $userManager,
            AddressHandler $addressHandler,
    Severity: Minor
    Found in apps/federatedfilesharing/lib/Controller/RequestHandlerController.php - About 45 mins to fix

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

              AddressHandler $addressHandler,
              IClientService $httpClientService,
              DiscoveryManager $discoveryManager,
              NotificationManager $notificationManager,
              IJobList $jobList,
      Severity: Minor
      Found in apps/federatedfilesharing/lib/Notifications.php - About 45 mins to fix

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

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

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

              public function requestReShare($token, $id, $shareId, $remote, $shareWith, $permission) {
          Severity: Minor
          Found in apps/federatedfilesharing/lib/Notifications.php - About 45 mins to fix

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

                public function httpPost(RequestInterface $request, ResponseInterface $response) {
                    $path = $request->getPath();
            
                    // Only handling xml
                    $contentType = $request->getHeader('Content-Type');
            Severity: Minor
            Found in apps/dav/lib/CalDAV/Publishing/PublishPlugin.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

                    ISystemTag $tag,
                    $objectId,
                    $objectType,
                    IUser $user,
                    ISystemTagManager $tagManager,
            Severity: Minor
            Found in apps/dav/lib/SystemTag/SystemTagMappingNode.php - About 45 mins to fix

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

                  public function logException(\Throwable $ex) {
                      if ($ex->getPrevious() instanceof FileContentNotAllowedException) {
                          //Don't log because its already been logged may be by different
                          //app or so.
                          return null;
              Severity: Minor
              Found in apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.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 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
                              Severity
                              Category
                              Status
                              Source
                              Language