owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

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

                          public function insert($file, array $data) {
                              // normalize file
                              $file = $this->normalize($file);
                      
                              if (isset($this->partial[$file])) { //add any saved partial data
                      Severity: Minor
                      Found in lib/private/Files/Cache/Cache.php - About 1 hr to fix

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

                            public static function normalizePath($path, $stripTrailingSlash = true, $isAbsolutePath = false, $keepUnicode = false) {
                                if (self::$normalizedPathCache === null) {
                                    self::$normalizedPathCache = new CappedMemoryCache();
                                }
                        
                        
                        Severity: Minor
                        Found in lib/private/Files/Filesystem.php - About 1 hr to fix

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

                              public function verifyAppSignature($appId, $path = '', $force = false) {
                                  try {
                                      if ($path === '') {
                                          $path = $this->appLocator->getAppPath($appId);
                                      }
                          Severity: Minor
                          Found in lib/private/IntegrityCheck/Checker.php - About 1 hr to fix

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

                                public function __construct($storage, $isAvailable = true) {
                                    if ($storage instanceof \OC\Files\Storage\Storage) {
                                        $this->storageId = $storage->getId();
                                    } else {
                                        $this->storageId = $storage;
                            Severity: Minor
                            Found in lib/private/Files/Cache/Storage.php - About 1 hr to fix

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

                                  public function tagAs($objid, $tag) {
                                      if (\is_string($tag) && !\is_numeric($tag)) {
                                          $tag = \trim($tag);
                                          if ($tag === '') {
                                              \OCP\Util::writeLog('core', __METHOD__.', Cannot add an empty tag', \OCP\Util::DEBUG);
                              Severity: Minor
                              Found in lib/private/Tags.php - About 1 hr to fix

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

                                    protected function oldDatabaseTables() {
                                        return [
                                            'calendar_calendars',
                                            'calendar_objects',
                                            'calendar_share_calendar',
                                Severity: Minor
                                Found in lib/private/Repair/DropOldTables.php - About 1 hr to fix

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

                                      private function changeSchema(Schema $schema, array $options) {
                                          $prefix = $options['tablePrefix'];
                                          if ($schema->hasTable("{$prefix}jobs")) {
                                              $jobsTable = $schema->getTable("{$prefix}jobs");
                                  
                                  
                                  Severity: Minor
                                  Found in lib/private/Repair/Apps.php - About 1 hr to fix

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

                                        private function processOCS(array $routes) {
                                            $ocsRoutes = isset($routes['ocs']) ? $routes['ocs'] : [];
                                            foreach ($ocsRoutes as $ocsRoute) {
                                                $name = $ocsRoute['name'];
                                                $postFix = '';
                                    Severity: Minor
                                    Found in lib/private/AppFramework/Routing/RouteConfig.php - About 1 hr to fix

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

                                          private function executeController($controller, $methodName) {
                                              $arguments = [];
                                      
                                              // valid types that will be casted
                                              $types = ['int', 'integer', 'bool', 'boolean', 'float'];
                                      Severity: Minor
                                      Found in lib/private/AppFramework/Http/Dispatcher.php - About 1 hr to fix

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

                                            public static function updateApp($appId) {
                                                \OC::$server->getAppManager()->clearAppsCache();
                                                $appPath = self::getAppPath($appId);
                                                if ($appPath === false) {
                                                    return false;
                                        Severity: Minor
                                        Found in lib/private/legacy/app.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language