owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

    public static function getSharesFromItem($target) {
        $result = [];
        $owner = Filesystem::getOwner($target);
        Filesystem::initMountPoints($owner);
        $info = Filesystem::getFileInfo($target);
Severity: Minor
Found in apps/files_sharing/lib/Helper.php - About 1 hr to fix

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

        public function expireTrash(string $uid) {
            $trashBinSize = Trashbin::getTrashbinSize($uid);
            $availableSpace = $this->quota->calculateFreeSpace($trashBinSize, $uid);
    
            // delete all files older then $retention_obligation
    Severity: Minor
    Found in apps/files_trashbin/lib/TrashExpiryManager.php - About 1 hr to fix

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

          public function registerHooks() {
              $container = $this->getContainer();
              $hooksManager = new Hooks($container->query('TrustedServers'));
      
              Util::connectHook(
      Severity: Minor
      Found in apps/federation/lib/AppInfo/Application.php - About 1 hr to fix

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

            public function convertToOcmFileNotification($remoteId, $token, $action, $data = []) {
                $notification = new FileNotification();
                $map = [
                    'accept' => FileNotification::NOTIFICATION_TYPE_SHARE_ACCEPTED,
                    'decline' => FileNotification::NOTIFICATION_TYPE_SHARE_DECLINED,
        Severity: Minor
        Found in apps/federatedfilesharing/lib/Ocm/NotificationManager.php - About 1 hr to fix

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

              public function getSubscriptionsForUser($principalUri) {
                  $fields = \array_values($this->subscriptionPropertyMap);
                  $fields[] = 'id';
                  $fields[] = 'uri';
                  $fields[] = 'source';
          Severity: Minor
          Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 1 hr to fix

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

                private function createAddressbookChangesTable(Schema $schema) {
                    if (!$schema->hasTable("{$this->prefix}addressbookchanges")) {
                        $table = $schema->createTable("{$this->prefix}addressbookchanges");
                        $table->addColumn('id', 'integer', [
                            'autoincrement' => true,
            Severity: Minor
            Found in apps/dav/appinfo/Migrations/Version20170116150538.php - About 1 hr to fix

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

                  private function createCalendarChangesTable(Schema $schema) {
                      if (!$schema->hasTable("{$this->prefix}calendarchanges")) {
                          $table = $schema->createTable("{$this->prefix}calendarchanges");
                          $table->addColumn('id', 'integer', [
                              'autoincrement' => true,
              Severity: Minor
              Found in apps/dav/appinfo/Migrations/Version20170116150538.php - About 1 hr to fix

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

                    public function stream_read($count) {
                        $node = null;
                        $lastNode = null;
                        do {
                            if ($this->currentStream === null) {
                Severity: Minor
                Found in apps/dav/lib/Upload/AssemblyStream.php - About 1 hr to fix

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

                      public function update(
                          $id,
                          $backendOptions,
                          $testOnly = true
                      ) {
                  Severity: Minor
                  Found in apps/files_external/lib/Controller/UserGlobalStoragesController.php - About 1 hr to fix

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

                        protected function updateProperties($addressBookId, $cardUri, $vCardSerialized) {
                            $cardId = $this->getCardId($addressBookId, $cardUri);
                            $vCard = $this->readCard($vCardSerialized);
                    
                            $this->purgeProperties($addressBookId, $cardId);
                    Severity: Minor
                    Found in apps/dav/lib/CardDAV/CardDavBackend.php - About 1 hr to fix

                      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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language