owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method copy has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function copy($sourcePath, $destinationPath) {
        $sourceNode = $this->getNodeForPath($sourcePath);
        if ($sourceNode instanceof File
            || $sourceNode instanceof Directory
        ) {
Severity: Minor
Found in apps/dav/lib/Tree.php - About 1 hr to fix

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

        public function __construct($params) {
            // log switch might be set already (from a subclass), so don't change it.
            if (!isset($this->logActive)) {
                $this->logActive = \OC::$server->getConfig()->getSystemValue('smb.logging.enable', false) === true;
            }
    Severity: Minor
    Found in apps/files_external/lib/Lib/Storage/SMB.php - About 1 hr to fix

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

          public function update(Entity $entity) {
              // if entity wasn't changed it makes no sense to run a db query
              $properties = $entity->getUpdatedFields();
              if (\count($properties) === 0) {
                  return $entity;
      Severity: Minor
      Found in lib/public/AppFramework/Db/Mapper.php - About 1 hr to fix

        Method getStatusInfo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getStatusInfo($includeVersion = false, $serverHide = false, $hostnameShort = false) {
                $systemConfig = \OC::$server->getSystemConfig();
        
                $installed = (bool) $systemConfig->getValue('installed', false);
                $maintenance = (bool) $systemConfig->getValue('maintenance', false);
        Severity: Minor
        Found in lib/public/Util.php - About 1 hr to fix

          Method getBuiltInPanels has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function getBuiltInPanels($type) {
                  if ($type === 'admin') {
                      return [
                          Enforce2fa::class,
                          LegacyAdmin::class,
          Severity: Minor
          Found in lib/private/Settings/SettingsManager.php - About 1 hr to fix

            Method runHooks has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function runHooks($hooks, $path, $post = false) {
                    if (empty($hooks)) {
                        return true;
                    }
                    $relativePath = $path;
            Severity: Minor
            Found in lib/private/Files/View.php - About 1 hr to fix

              Method stream_write has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function stream_write($data) {
                      $length = 0;
                      // loop over $data to fit it in 6126 sized unencrypted blocks
                      while (isset($data[0])) {
                          $remainingLength = \strlen($data);
              Severity: Minor
              Found in lib/private/Files/Stream/Encryption.php - About 1 hr to fix

                Method detect has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function detect($path) {
                        $this->loadMappings();
                
                        if (@\is_dir($path)) {
                            // directories are easy
                Severity: Minor
                Found in lib/private/Files/Type/Detection.php - About 1 hr to fix

                  Method commitBatch has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function commitBatch() {
                          if (!$this->inBatch) {
                              throw new \BadMethodCallException('Not in batch');
                          }
                          $this->inBatch = false;
                  Severity: Minor
                  Found in lib/private/Files/Cache/Propagator.php - About 1 hr to fix

                    Method makeTheme has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function makeTheme($themeName, $appTheme = true) {
                            $serverRoot = $this->environmentHelper->getServerRoot();
                            $baseDirectory = $serverRoot;
                            $directory = '';
                            $webPath = '';
                    Severity: Minor
                    Found in lib/private/Theme/ThemeService.php - About 1 hr to fix

                      Method addStorage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function addStorage(IStorageConfig $newStorage) {
                              $allStorages = $this->readConfig();
                      
                              $configId = $this->dbConfig->addMount(
                                  $newStorage->getMountPoint(),
                      Severity: Minor
                      Found in lib/private/Files/External/Service/StoragesService.php - About 1 hr to fix

                        Method deleteOrphanEntries has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function deleteOrphanEntries(IOutput $output, $repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) {
                                $qb = $this->connection->getQueryBuilder();
                        
                                $qb->select('d.' . $deleteId)
                                    ->from($deleteTable, 'd')
                        Severity: Minor
                        Found in lib/private/Repair/CleanTags.php - About 1 hr to fix

                          Method addQueryConditionsParentIdWrongPath has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function addQueryConditionsParentIdWrongPath($qb) {
                                  // thanks, VicDeo!
                                  if ($this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
                                      $concatFunction = $qb->createFunction("CONCAT(fcp.path, '/', fc.name)");
                                  } else {
                          Severity: Minor
                          Found in lib/private/Repair/RepairMismatchFileCachePath.php - About 1 hr to fix

                            Method createShare has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function createShare($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 lib/private/Share20/DefaultShareProvider.php - About 1 hr to fix

                              Method cropAndFill has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function cropAndFill($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight) {
                                      if ($previewWidth > $askedWidth) {
                                          $cropX = \floor(($previewWidth - $askedWidth) * 0.5);
                                          $image->crop($cropX, 0, $askedWidth, $previewHeight);
                                          $previewWidth = $askedWidth;
                              Severity: Minor
                              Found in lib/private/Preview.php - About 1 hr to fix

                                Method findAppInDirectories has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function findAppInDirectories($appId) {
                                        $sanitizedAppId = \OC_App::cleanAppId($appId);
                                        if ($sanitizedAppId !== $appId) {
                                            return false;
                                        }
                                Severity: Minor
                                Found in lib/private/App/AppManager.php - About 1 hr to fix

                                  Method adjustStreamChunkSize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private function adjustStreamChunkSize($handle) {
                                          $stream = $handle;
                                          $metadata = \stream_get_meta_data($stream);
                                          while ($metadata['stream_type'] === 'user-space') {
                                              \stream_set_chunk_size($stream, 64 * 1024);
                                  Severity: Minor
                                  Found in lib/private/legacy/image.php - About 1 hr to fix

                                    Method getAccessList has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function getAccessList($path) {
                                            // Make sure that a share key is generated for the owner too
                                            list($owner, $ownerPath) = $this->util->getUidAndFilename($path);
                                    
                                            // always add owner to the list of users with access to the file
                                    Severity: Minor
                                    Found in lib/private/Encryption/File.php - About 1 hr to fix

                                      Method decryptAll has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function decryptAll(InputInterface $input, OutputInterface $output, $user = '') {
                                              $this->input = $input;
                                              $this->output = $output;
                                      
                                              if ($user !== '' && $this->userManager->userExists($user) === false) {
                                      Severity: Minor
                                      Found in lib/private/Encryption/DecryptAll.php - About 1 hr to fix

                                        Method syncHome has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function syncHome(Account $a, UserInterface $backend) {
                                                // Fallback for backends that dont yet use the new interfaces
                                                $providesHome = $backend instanceof IProvidesHomeBackend || $backend->implementsActions(\OC_User_Backend::GET_HOME);
                                                $uid = $a->getUserId();
                                                // Log when the backend returns a string that is a different home to the current value
                                        Severity: Minor
                                        Found in lib/private/User/SyncService.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language