owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

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

        \OCP\L10N\IFactory $factory,
        INotificationManager $notificationManager,
        IShareManager $shareManager,
        IGroupManager $groupManager,
        IUserManager $userManager,
Severity: Minor
Found in apps/files_sharing/lib/Notifier.php - About 45 mins to fix

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

        private function dirRecursiveCheck(Folder $dirInfo) {
            if (!$this->checkFileInfo($dirInfo)) {
                return false;
            }
            // If any of elements cannot be downloaded, prevent whole download
    Severity: Minor
    Found in apps/files_sharing/lib/ViewOnly.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

            \OCP\IDBConnection                 $connection,
            \OC\Files\Mount\Manager            $mountManager,
            \OCP\Files\Storage\IStorageFactory $storageLoader,
            IManager                           $notificationManager,
            EventDispatcherInterface           $eventDispatcher,
    Severity: Minor
    Found in apps/files_sharing/lib/External/Manager.php - About 45 mins to fix

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

          public function getChildren($itemSource) {
              $children = [];
              $parents = [$itemSource];
              $query = \OCP\DB::prepare('SELECT `id` FROM `*PREFIX*mimetypes` WHERE `mimetype` = ?');
              $result = $query->execute(['httpd/unix-directory']);
      Severity: Minor
      Found in apps/files_sharing/lib/ShareBackend/Folder.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

              IClient $httpClient = null,
              IURLGenerator $urlGenerator = null,
              IJobList $jobList = null,
              TrustedServers $trustedServers = null,
              ILogger $logger = null,
      Severity: Minor
      Found in apps/federation/lib/BackgroundJob/GetSharedSecret.php - About 45 mins to fix

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

            private static function retainVersions($filename, $owner, $ownerPath, $timestamp, $sourceStorage = null, $forceCopy = false) {
        Severity: Minor
        Found in apps/files_trashbin/lib/Trashbin.php - About 45 mins to fix

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

              private function linkShareAuth(\OCP\Share\IShare $share, $password = null) {
                  $beforeEvent = new GenericEvent(null, ['shareObject' => $share]);
                  $this->eventDispatcher->dispatch($beforeEvent, 'share.beforelinkauth');
                  if ($password !== null) {
                      if ($this->shareManager->checkPassword($share, $password)) {
          Severity: Minor
          Found in apps/files_sharing/lib/Controllers/ShareController.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 translate has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
          Severity: Minor
          Found in apps/systemtags/lib/Activity/Extension.php - About 45 mins to fix

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

                protected function run($argument) {
                    $target = $argument['url'];
                    $source = $this->urlGenerator->getAbsoluteURL('/');
                    $source = \rtrim($source, '/');
                    $token = $argument['token'];
            Severity: Minor
            Found in apps/federation/lib/BackgroundJob/RequestSharedSecret.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

                    $appName,
                    IRequest $request,
                    \OCA\Files_Sharing\External\Manager $externalManager,
                    IClientService $clientService,
                    EventDispatcherInterface $eventDispatcher,
            Severity: Minor
            Found in apps/files_sharing/lib/Controllers/ExternalSharesController.php - About 45 mins to fix

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

                  public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
              Severity: Minor
              Found in apps/comments/lib/Activity/Extension.php - About 45 mins to fix

                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

                            Severity
                            Category
                            Status
                            Source
                            Language