owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method generateTokenAndSendMail has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function generateTokenAndSendMail($userId, $email) {
        $token = $this->secureRandom->generate(
            21,
            ISecureRandom::CHAR_DIGITS,
            ISecureRandom::CHAR_LOWER,
Severity: Minor
Found in settings/Controller/UsersController.php - About 1 hr to fix

    Method notifyPublicLinkRecipientsByEmail has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function notifyPublicLinkRecipientsByEmail($link, $recipients, $personalNote) {
            # verify that the link is for a trusted domain
            if (!$this->trustedDomainHelper->isUrlTrusted($link)) {
                return new Result(null, 400, "Invalid shared link");
            }
    Severity: Minor
    Found in apps/files_sharing/lib/Controller/NotificationController.php - About 1 hr to fix

      Method createComment has 28 lines of code (exceeds 25 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 1 hr to fix

        Method createShareObject has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function createShareObject($data) {
                $share = new Share($this->rootFolder, $this->userManager);
                $share->setId($data['id'])
                    ->setShareType((int)$data['share_type'])
                    ->setPermissions((int)$data['permissions'])
        Severity: Minor
        Found in apps/federatedfilesharing/lib/FederatedShareProvider.php - About 1 hr to fix

          Method getUsersGroups has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getUsersGroups($parameters) {
                  // Check if user is logged in
                  $loggedInUser = $this->userSession->getUser();
                  if ($loggedInUser === null) {
                      return new Result(null, API::RESPOND_UNAUTHORISED);
          Severity: Minor
          Found in apps/provisioning_api/lib/Users.php - About 1 hr to fix

            Method update has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function update($name, $userVisible, $userAssignable, $userEditable = false) {
                    try {
                        if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) {
                            throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist');
                        }
            Severity: Minor
            Found in apps/dav/lib/SystemTag/SystemTagNode.php - About 1 hr to fix

              Method getUser has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getUser($parameters) {
                      $userId = $parameters['userid'];
              
                      // Check if user is logged in
                      $currentLoggedInUser = $this->userSession->getUser();
              Severity: Minor
              Found in apps/provisioning_api/lib/Users.php - About 1 hr to fix

                Method check has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function check(RequestInterface $request, ResponseInterface $response) {
                        $node = $this->resolveShare($request->getPath());
                        if (!$node instanceof PublicSharedRootNode) {
                            return [true, 'principals/system/public'];
                        }
                Severity: Minor
                Found in apps/dav/lib/Files/PublicFiles/PublicSharingAuth.php - About 1 hr to fix

                  Method getSystemTagFileIds has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function getSystemTagFileIds($systemTagIds) {
                          $resultFileIds = null;
                  
                          // check user permissions, if applicable
                          if (!$this->isAdmin()) {
                  Severity: Minor
                  Found in apps/dav/lib/Connector/Sabre/FilesReportPlugin.php - About 1 hr to fix

                    Method getChild has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getChild($name, $info = null) {
                            if (!$this->info->isReadable()) {
                                // avoid detecting files through this way
                                throw new SabreNotFound();
                            }
                    Severity: Minor
                    Found in apps/dav/lib/Connector/Sabre/Directory.php - About 1 hr to fix

                      Method updateStorageStatus has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function updateStorageStatus(IStorageConfig &$storage, $testOnly = true) {
                              try {
                                  $this->manipulateStorageConfig($storage);
                      
                                  /** @var Backend */
                      Severity: Minor
                      Found in apps/files_external/lib/Controller/StoragesController.php - About 1 hr to fix

                        Method checkQuota has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function checkQuota($path, $length = null, $extraSpace = 0) {
                                if ($length === null) {
                                    $length = $this->getLength();
                                }
                                if ($length !== null) {
                        Severity: Minor
                        Found in apps/dav/lib/Connector/Sabre/QuotaPlugin.php - About 1 hr to fix

                          Method processUserChunks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function processUserChunks($input, $output, $users, $inputPath, $shouldRepairStoragesIndividually, $group = null) {
                                  # no messaging level option means: no full printout but statistics
                                  # $quiet   means no print at all
                                  # $verbose means full printout including statistics
                                  # -q    -v    full    stat
                          Severity: Minor
                          Found in apps/files/lib/Command/Scan.php - About 1 hr to fix

                            Method hasUpdated has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function hasUpdated($path, $time) {
                                    if ($this->is_file($path)) {
                                        return parent::hasUpdated($path, $time);
                                    }
                            
                            
                            Severity: Minor
                            Found in apps/files_external/lib/Lib/Storage/Google.php - About 1 hr to fix

                              Method getTagIdsForObjects has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getTagIdsForObjects($objIds, $objectType) {
                                      if (!\is_array($objIds)) {
                                          $objIds = [$objIds];
                                      } elseif (empty($objIds)) {
                                          return [];
                              Severity: Minor
                              Found in lib/private/SystemTag/SystemTagObjectMapper.php - About 1 hr to fix

                                Method stream_seek has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function stream_seek($offset, $whence = SEEK_SET) {
                                        $return = false;
                                
                                        switch ($whence) {
                                            case SEEK_SET:
                                Severity: Minor
                                Found in lib/private/Files/Stream/Encryption.php - About 1 hr to fix

                                  Method copyFromStorage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
                                          if ($sourceStorage === $this) {
                                              return $this->copy($sourceInternalPath, $targetInternalPath);
                                          }
                                  
                                  
                                  Severity: Minor
                                  Found in lib/private/Files/Storage/Common.php - About 1 hr to fix

                                    Method getBackendStatus has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function getBackendStatus($class, $options, $isPersonal, $testOnly = true) {
                                            if (self::$skipTest) {
                                                return StorageNotAvailableException::STATUS_SUCCESS;
                                            }
                                            $user = \OC::$server->getUserSession()->getUser();
                                    Severity: Minor
                                    Found in lib/private/Files/External/LegacyUtil.php - About 1 hr to fix

                                      Method setExpirationDate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public static function setExpirationDate($itemType, $itemSource, $date, $shareTime = null) {
                                              $user = \OC_User::getUser();
                                              $l = \OC::$server->getL10N('lib');
                                      
                                              if ($date == '') {
                                      Severity: Minor
                                      Found in lib/private/Share/Share.php - About 1 hr to fix

                                        Method run has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function run(IOutput $out) {
                                                if (!$this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
                                                    return;
                                                }
                                        
                                        
                                        Severity: Minor
                                        Found in lib/private/Repair/SqliteAutoincrement.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language