owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function calculate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        calculate: function(files) {
            var file;
            var summary = {
                totalDirs: 0,
                totalFiles: 0,
Severity: Minor
Found in apps/files/js/filesummary.js - About 1 hr to fix

    Function getDescriptiveTag has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            getDescriptiveTag: function(tag) {
                if (_.isUndefined(tag.name) && !_.isUndefined(tag.toJSON)) {
                    tag = tag.toJSON();
                }
    
    
    Severity: Minor
    Found in core/js/systemtags/systemtags.js - About 1 hr to fix

      Function addAndFetchFileInfo has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              addAndFetchFileInfo: function(fileName, dir, options) {
                  var self = this;
                  var deferred = $.Deferred();
                  if (_.isUndefined(dir)) {
                      dir = this.getCurrentDirectory();
      Severity: Minor
      Found in apps/files/js/filelist.js - About 1 hr to fix

        Function parse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                parse: function(data) {
                    /* jshint camelcase: false */
                    if (data.ocs && data.ocs.data) {
                        // parse out of the ocs response
                        data = data.ocs.data;
        Severity: Minor
        Found in core/js/sharemodel.js - About 1 hr to fix

          Function lock has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  lock: function(path, options) {
                      if (!path) {
                          throw 'Missing argument "path"';
                      }
                      var self = this;
          Severity: Minor
          Found in core/js/files/client.js - About 1 hr to fix

            Function showHtml has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                showHtml: function (html, options) {
                    options = options || {};
                    _.defaults(options, {
                        timeout: 0
                    });
            Severity: Minor
            Found in core/js/js.js - About 1 hr to fix

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

                  public function getPanel() {
                      $activeLangCode = $this->config->getUserValue(
                          $this->userSession->getUser()->getUID(),
                          'core',
                          'lang',
              Severity: Minor
              Found in settings/Panels/Personal/Profile.php - About 1 hr to fix

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

                    public function isTargetAllowed($target) {
                        $currentMount = $this->getMountPoint();
                        // note: $currentMount has a trailing slash. It doesn't matter for the check below
                        $isRename = \dirname($currentMount) === \dirname($target);
                
                
                Severity: Minor
                Found in apps/files_sharing/lib/SharedMount.php - About 1 hr to fix

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

                      public function setPasswordForm($token, $userId) {
                          try {
                              $this->checkPasswordSetToken($token, $userId);
                          } catch (UserTokenException $e) {
                              if ($e instanceof UserTokenExpiredException) {
                  Severity: Minor
                  Found in settings/Controller/UsersController.php - About 1 hr to fix

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

                        private function addCertificate(ICertificateManager $certificateManager) {
                            $headers = [];
                            if ($this->request->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE_8])) {
                                // due to upload iframe workaround, need to set content-type to text/plain
                                $headers['Content-Type'] = 'text/plain';
                    Severity: Minor
                    Found in settings/Controller/CertificateController.php - About 1 hr to fix

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

                          private function getAuthors($file, $gitRoot) {
                              // only add authors that changed code and not the license header
                              $licenseHeaderEndsAtLine = \trim(\shell_exec(\sprintf("grep -n '*/' %s | head -n 1 | cut -d ':' -f 1", \escapeshellarg($file))));
                      
                              $buildDir = \getcwd();
                      Severity: Minor
                      Found in build/license.php - About 1 hr to fix

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

                            public static function getShareFolder($view = null) {
                                if ($view === null) {
                                    $view = Filesystem::getView();
                                }
                                // for guests we default to root as their home storage is read-only
                        Severity: Minor
                        Found in apps/files_sharing/lib/Helper.php - About 1 hr to fix

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

                              private function getPermissionsFromRequest() {
                                  // int-based permissions are set -> use them
                                  $permissions = $this->request->getParam('permissions', null);
                                  if ($permissions !== null) {
                                      return $permissions;
                          Severity: Minor
                          Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 1 hr to fix

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

                                private static function deleteVersions(View $view, $file, $user) {
                                    $size = 0;
                                    if (\OCP\App::isEnabled('files_versions')) {
                                        if ($view->is_dir('files_trashbin/versions/' . $file)) {
                                            $size += self::calculateSize(new View('/' . $user . '/files_trashbin/versions/' . $file));
                            Severity: Minor
                            Found in apps/files_trashbin/lib/Trashbin.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_trashbin/lib/Command/CleanUp.php - About 1 hr to fix

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

                                    private function ocmDiscover($remote) {
                                        // Check if something is in the cache
                                        if ($cacheData = $this->cache->get('OCM' . $remote)) {
                                            return \json_decode($cacheData, true);
                                        }
                                Severity: Minor
                                Found in apps/federatedfilesharing/lib/DiscoveryManager.php - About 1 hr to fix

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

                                      public function splitUserRemote($address) {
                                          if (\strpos($address, '@') === false) {
                                              $hint = $this->l->t('Invalid Federated Cloud ID');
                                              throw new HintException('Invalid Federated Cloud ID', $hint);
                                          }
                                  Severity: Minor
                                  Found in apps/federatedfilesharing/lib/AddressHandler.php - About 1 hr to fix

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

                                        public function getUsers() {
                                            $search = !empty($_GET['search']) ? $_GET['search'] : '';
                                            $limit = !empty($_GET['limit']) ? $_GET['limit'] : null;
                                            $offset = !empty($_GET['offset']) ? $_GET['offset'] : null;
                                    
                                    
                                    Severity: Minor
                                    Found in apps/provisioning_api/lib/Users.php - About 1 hr to fix

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

                                          public function getMultipleCalendarObjects($calendarId, array $uris) {
                                              $chunkSize = 998;
                                              if (\count($uris) <= $chunkSize) {
                                                  $query = $this->db->getQueryBuilder();
                                                  $query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
                                      Severity: Minor
                                      Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 1 hr to fix

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

                                            public function initialize(\Sabre\DAV\Server $server) {
                                                $server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
                                                $server->protectedProperties[] = self::FILEID_PROPERTYNAME;
                                                $server->protectedProperties[] = self::INTERNAL_FILEID_PROPERTYNAME;
                                                $server->protectedProperties[] = self::PERMISSIONS_PROPERTYNAME;
                                        Severity: Minor
                                        Found in apps/dav/lib/Connector/Sabre/FilesPlugin.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language