owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method getAuthors has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getAuthors($file, $gitRoot) {
        // only add authors that changed code and not the license header
        $licenseHeaderEndsAtLine = \trim(\shell_exec(\sprintf("grep -n '*/' %s | head -n 1 | cut -d ':' -f 1", \escapeshellarg($file))));

        $buildDir = \getcwd();
Severity: Minor
Found in build/license.php - About 1 hr to fix

    Method getShareFolder has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getShareFolder($view = null) {
            if ($view === null) {
                $view = Filesystem::getView();
            }
            // for guests we default to root as their home storage is read-only
    Severity: Minor
    Found in apps/files_sharing/lib/Helper.php - About 1 hr to fix

      Method getPermissionsFromRequest has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function getPermissionsFromRequest() {
              // int-based permissions are set -> use them
              $permissions = $this->request->getParam('permissions', null);
              if ($permissions !== null) {
                  return $permissions;
      Severity: Minor
      Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 1 hr to fix

        Method deleteVersions has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function deleteVersions(View $view, $file, $user) {
                $size = 0;
                if (\OCP\App::isEnabled('files_versions')) {
                    if ($view->is_dir('files_trashbin/versions/' . $file)) {
                        $size += self::calculateSize(new View('/' . $user . '/files_trashbin/versions/' . $file));
        Severity: Minor
        Found in apps/files_trashbin/lib/Trashbin.php - About 1 hr to fix

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

              protected function execute(InputInterface $input, OutputInterface $output): int {
                  $users = $input->getArgument('user_id');
                  if (!empty($users)) {
                      foreach ($users as $user) {
                          if ($this->userManager->userExists($user)) {
          Severity: Minor
          Found in apps/files_trashbin/lib/Command/CleanUp.php - About 1 hr to fix

            Method ocmDiscover has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function ocmDiscover($remote) {
                    // Check if something is in the cache
                    if ($cacheData = $this->cache->get('OCM' . $remote)) {
                        return \json_decode($cacheData, true);
                    }
            Severity: Minor
            Found in apps/federatedfilesharing/lib/DiscoveryManager.php - About 1 hr to fix

              Method splitUserRemote has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function splitUserRemote($address) {
                      if (\strpos($address, '@') === false) {
                          $hint = $this->l->t('Invalid Federated Cloud ID');
                          throw new HintException('Invalid Federated Cloud ID', $hint);
                      }
              Severity: Minor
              Found in apps/federatedfilesharing/lib/AddressHandler.php - About 1 hr to fix

                Method getUsers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getUsers() {
                        $search = !empty($_GET['search']) ? $_GET['search'] : '';
                        $limit = !empty($_GET['limit']) ? $_GET['limit'] : null;
                        $offset = !empty($_GET['offset']) ? $_GET['offset'] : null;
                
                
                Severity: Minor
                Found in apps/provisioning_api/lib/Users.php - About 1 hr to fix

                  Method getMultipleCalendarObjects has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getMultipleCalendarObjects($calendarId, array $uris) {
                          $chunkSize = 998;
                          if (\count($uris) <= $chunkSize) {
                              $query = $this->db->getQueryBuilder();
                              $query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
                  Severity: Minor
                  Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 1 hr to fix

                    Method initialize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function initialize(\Sabre\DAV\Server $server) {
                            $server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
                            $server->protectedProperties[] = self::FILEID_PROPERTYNAME;
                            $server->protectedProperties[] = self::INTERNAL_FILEID_PROPERTYNAME;
                            $server->protectedProperties[] = self::PERMISSIONS_PROPERTYNAME;
                    Severity: Minor
                    Found in apps/dav/lib/Connector/Sabre/FilesPlugin.php - About 1 hr to fix

                      Method validateUserPass has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function validateUserPass($username, $password) {
                              try {
                                  $share = $this->shareManager->getShareByToken($username);
                              } catch (ShareNotFound $e) {
                                  \OC::$server->getLogger()->error("PublicAuth: share for found $username");
                      Severity: Minor
                      Found in apps/dav/lib/Connector/PublicAuth.php - About 1 hr to fix

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

                          Method handlePut has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function handlePut(RequestInterface $request, ResponseInterface $response) {
                                  if ($request->getHeader('OC-Autorename') !== '1') {
                                      return;
                                  }
                          
                          
                          Severity: Minor
                          Found in apps/dav/lib/Connector/Sabre/AutorenamePlugin.php - About 1 hr to fix

                            Method createDirectory has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function createDirectory($name) {
                                    # the check here is necessary, because createDirectory does not use the methods in files/view.php
                                    if (Filesystem::isForbiddenFileOrDir($name)) {
                                        throw new SabreForbidden();
                                    }
                            Severity: Minor
                            Found in apps/dav/lib/Connector/Sabre/Directory.php - About 1 hr to fix

                              Method create has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function create(
                                      $mountPoint,
                                      $backend,
                                      $authMechanism,
                                      $backendOptions,
                              Severity: Minor
                              Found in apps/files_external/lib/Controller/GlobalStoragesController.php - About 1 hr to fix

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

                                    protected function execute(InputInterface $input, OutputInterface $output): int {
                                        $users = $input->getArgument('user_id');
                                        if (!empty($users)) {
                                            foreach ($users as $user) {
                                                if ($this->userManager->userExists($user)) {
                                Severity: Minor
                                Found in apps/files_versions/lib/Command/CleanUp.php - About 1 hr to fix

                                  Method configure has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function configure() {
                                          $this
                                              ->setName('files:transfer-ownership')
                                              ->setDescription('All files and folders are moved to another user - shares are moved as well.')
                                              ->addArgument(
                                  Severity: Minor
                                  Found in apps/files/lib/Command/TransferOwnership.php - About 1 hr to fix

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

                                        protected function execute(InputInterface $input, OutputInterface $output): int {
                                            $uid = $input->getArgument('uid');
                                            $userFolder = $this->rootFolder->getUserFolder($uid);  // might throw a NoUserException
                                    
                                            try {
                                    Severity: Minor
                                    Found in apps/files/lib/Command/CheckCache.php - About 1 hr to fix

                                      Method findOneQuery has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function findOneQuery($sql, array $params=[], $limit=null, $offset=null) {
                                              if ($sql instanceof IQueryBuilder) {
                                                  $stmt = $sql->execute();
                                              } else {
                                                  $stmt = $this->execute($sql, $params, $limit, $offset);
                                      Severity: Minor
                                      Found in lib/public/AppFramework/Db/Mapper.php - About 1 hr to fix

                                        Method fopen has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function fopen($mode) {
                                                $preHooks = [];
                                                $postHooks = [];
                                                $requiredPermissions = \OCP\Constants::PERMISSION_READ;
                                                switch ($mode) {
                                        Severity: Minor
                                        Found in lib/private/Files/Node/File.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language