owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Function initMouseTrack has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function initMouseTrack() {
        var interval = 120;  // 2 minutes
        if (oc_config.session_lifetime) {
            interval = Math.floor(oc_config.session_lifetime / 2);
        }
Severity: Minor
Found in core/js/js.js - About 1 hr to fix

    Method translateShort has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function translateShort($text, IL10N $l, array $params) {
            switch ($text) {
                case self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED:
                case self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED:
                    return (string) $l->t('Downloaded via public link');
    Severity: Minor
    Found in apps/files_sharing/lib/Activity.php - About 1 hr to fix

      Method prepare has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function prepare(INotification $notification, $languageCode) {
              if ($notification->getApp() !== 'files_sharing') {
                  // Not my app => throw
                  throw new \InvalidArgumentException();
              }
      Severity: Minor
      Found in apps/federatedfilesharing/lib/Notifier.php - About 1 hr to fix

        Method commentEvent has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function commentEvent(CommentsEvent $event) {
                if ($event->getComment()->getObjectType() !== 'files'
                    || !\in_array($event->getEvent(), [CommentsEvent::EVENT_ADD])
                    || !$this->appManager->isInstalled('activity')) {
                    // Comment not for file, not adding a comment or no activity-app enabled (save the energy)
        Severity: Minor
        Found in apps/comments/lib/Activity/Listener.php - About 1 hr to fix

          Method restoreVersion has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function restoreVersion($uid, $filename, $fileToRestore, $revision) {
                  if (\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED) !== true) {
                      return false;
                  }
                  $users_view = new View('/'.$uid);
          Severity: Minor
          Found in apps/files_versions/lib/Storage.php - About 1 hr to fix

            Method get has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get($file) {
                    if (\is_string($file) or $file == '') {
                        // normalize file
                        $file = $this->normalize($file);
            
            
            Severity: Minor
            Found in lib/private/Files/Cache/Cache.php - About 1 hr to fix

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

                  public function __construct($data = []) {
                      $factory = new InputFilterFactory();
                      $this->inputFilter = $factory->createInputFilter([
                          'file' => [
                              'required' => true,
              Severity: Minor
              Found in lib/private/Share/Filters/MailNotificationFilter.php - About 1 hr to fix

                Method generalChecks has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function generalChecks(\OCP\Share\IShare $share) {
                        if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
                            // We expect a valid user as sharedWith for user shares
                            if (!$this->userManager->userExists($share->getSharedWith())) {
                                throw new \InvalidArgumentException('SharedWith is not a valid user');
                Severity: Minor
                Found in lib/private/Share20/Manager.php - About 1 hr to fix

                  Method loginWithApache has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function loginWithApache(IApacheBackend $apacheBackend) {
                          $uidAndBackend = $apacheBackend->getCurrentUserId();
                          if (\is_array($uidAndBackend)
                              && \count($uidAndBackend) === 2
                              && $uidAndBackend[0] !== ''
                  Severity: Minor
                  Found in lib/private/User/Session.php - About 1 hr to fix

                    Method new has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function new(?string $parent_container_id, ?string $filename): DataResponse {
                            $userAgent = $this->request->getHeader('User-Agent') ?? '-';
                            $this->logger->info("new($parent_container_id, $filename) - $userAgent");
                    
                            if ($parent_container_id === null) {
                    Severity: Minor
                    Found in core/Controller/AppRegistryController.php - About 1 hr to fix

                      Function ocFederationAddServer has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.fn.ocFederationAddServer = function() {
                      
                              /* Go easy on jquery and define some vars
                              ========================================================================== */
                      
                      
                      Severity: Minor
                      Found in apps/federation/js/settings-admin.js - About 1 hr to fix

                        Function render has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                render: function() {
                                    var self = this;
                                    var fileActions = this._context.fileActions;
                                    var actions = fileActions.getActions(
                                        fileActions.getCurrentMimeType(),
                        Severity: Minor
                        Found in apps/files/js/fileactionsmenu.js - About 1 hr to fix

                          Function done has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              done: function() {
                                  if (!this.data.isChunked) {
                                      return $.Deferred().resolve().promise();
                                  }
                          
                          
                          Severity: Minor
                          Found in apps/files/js/file-upload.js - About 1 hr to fix

                            Method addShare has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function addShare($remote, $token, $password, $name, $owner, $accepted = false, $user = null, $remoteId = -1) {
                                    $user = $user ? $user : $this->uid;
                                    $accepted = $accepted ? 1 : 0;
                                    $name = Filesystem::normalizePath('/' . $name);
                            
                            
                            Severity: Minor
                            Found in apps/files_sharing/lib/External/Manager.php - About 1 hr to fix

                              Method addUser has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function addUser() {
                                      $userId = isset($_POST['userid']) ? $_POST['userid'] : null;
                                      $password = isset($_POST['password']) ? $_POST['password'] : null;
                                      $groups = isset($_POST['groups']) ? $_POST['groups'] : null;
                                      $user = $this->userSession->getUser();
                              Severity: Minor
                              Found in apps/provisioning_api/lib/Users.php - About 1 hr to fix

                                Method getPublicCalendars has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

                                  Method reShare has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function reShare($id) {
                                          $token = $this->request->getParam('token', null);
                                          $shareWith = $this->request->getParam('shareWith', null);
                                          $permission = $this->request->getParam('permission', null);
                                          $remoteId = $this->request->getParam('remoteId', null);

                                    Method createCardsPropertiesTable has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

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

                                      Method createTag has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function createTag($data, $contentType = 'application/json'): ISystemTag {
                                              if (\explode(';', $contentType)[0] === 'application/json') {
                                                  $data = \json_decode($data, true);
                                              } else {
                                                  throw new UnsupportedMediaType();
                                      Severity: Minor
                                      Found in apps/dav/lib/SystemTag/SystemTagPlugin.php - About 1 hr to fix

                                        Method handleGetProperties has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function handleGetProperties(PropFind $propFind, INode $node) {
                                                if ($node instanceof MetaFolder) {
                                                    $propFind->handle(self::PATH_FOR_FILEID_PROPERTYNAME, function () use ($node) {
                                                        $fileId = $node->getName();
                                        
                                        
                                        Severity: Minor
                                        Found in apps/dav/lib/Meta/MetaPlugin.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language