owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

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

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

                                  private static function validateExpireDate($expireDate, $shareTime, $itemType, $itemSource) {
                                      $l = \OC::$server->getL10N('lib');
                                      $date = new \DateTime($expireDate);
                                      $today = new \DateTime('now');
                              
                              
                              Severity: Minor
                              Found in lib/private/Share/Share.php - About 1 hr to fix

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

                                    private function processSimpleRoutes($routes) {
                                        $simpleRoutes = isset($routes['routes']) ? $routes['routes'] : [];
                                        foreach ($simpleRoutes as $simpleRoute) {
                                            $name = $simpleRoute['name'];
                                            $postfix = '';
                                Severity: Minor
                                Found in lib/private/AppFramework/Routing/RouteConfig.php - About 1 hr to fix

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

                                      public function isCached() {
                                          $fileId = $this->getFile()->getId();
                                          if ($fileId === null) {
                                              return false;
                                          }
                                  Severity: Minor
                                  Found in lib/private/Preview.php - About 1 hr to fix

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

                                        public static function isAppCompatible($ocVersion, $appInfo) {
                                            $requireMin = '';
                                            $requireMax = '';
                                            if (isset($appInfo['dependencies']['owncloud']['@attributes']['min-version'])) {
                                                $requireMin = $appInfo['dependencies']['owncloud']['@attributes']['min-version'];
                                    Severity: Minor
                                    Found in lib/private/legacy/app.php - About 1 hr to fix

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

                                          protected static function getShippedApps() {
                                              $shippedApps = [];
                                              foreach (\OC::$APPSROOTS as $app_dir) {
                                                  if ($dir = \opendir($app_dir['path'])) {
                                                      $nodes = \scandir($app_dir['path']);
                                      Severity: Minor
                                      Found in lib/private/Installer.php - About 1 hr to fix

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

                                            public static function useBackend($backend = 'database') {
                                                if ($backend instanceof \OCP\UserInterface) {
                                                    self::$_usedBackends[\get_class($backend)] = $backend;
                                                    \OC::$server->getUserManager()->registerBackend($backend);
                                                } else {
                                        Severity: Minor
                                        Found in lib/private/legacy/user.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language