owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method getFontFile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getFontFile(array $info): string {
        $fontFileDir  = __DIR__;
        $fontFileDir .= '/../../../core/fonts/';

        $fontSet = [
Severity: Minor
Found in lib/private/Preview/TXT.php - About 1 hr to fix

    Method userCreateChecks has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function userCreateChecks(\OCP\Share\IShare $share) {
            $userTypeHelper = new UserTypeHelper();
            $isGuestUser = $userTypeHelper->isGuestUser($share->getSharedWith());
            // Check if we can share with group members only
            // We still should be able to share with guest user even when it's not a group member
    Severity: Minor
    Found in lib/private/Share20/Manager.php - About 1 hr to fix

      Method getAllSharesBy has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getAllSharesBy($userId, $shareTypes, $nodeIDs, $reshares) {
              $shares = [];
              $qb = $this->dbConn->getQueryBuilder();
      
              $qb->select('*')
      Severity: Minor
      Found in lib/private/Share20/DefaultShareProvider.php - About 1 hr to fix

        Method getPreview has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getPreview() {
                if ($this->preview !== null && $this->preview->valid()) {
                    return $this->preview;
                }
        
        
        Severity: Minor
        Found in lib/private/Preview.php - About 1 hr to fix

          Method loginInOwnCloud has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function loginInOwnCloud($loginType, $user, $password, $options = []) {
                  $login = $user->getUID();
          
                  // check the login policies first. It will throw a LoginException if needed
                  // The LoginPolicyManager can't be injected due to cyclic dependency
          Severity: Minor
          Found in lib/private/User/Session.php - About 1 hr to fix

            Method execute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function execute(InputInterface $input, OutputInterface $output): int {
                    $output->writeln('<info>This feature is currently experimental.</info>');
                    $this->targetType = $this->connectionFactory->normalizeType($input->getArgument('type'));
                    $this->targetHostname = $input->getArgument('hostname');
                    $this->targetPort = $input->getOption('port');
            Severity: Minor
            Found in core/Command/Db/ConvertType.php - About 1 hr to fix

              Method execute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function execute(InputInterface $input, OutputInterface $output): int {
                      if (Filesystem::isPrimaryObjectStorageEnabled() === true) {
                          $output->writeln('<info>We detected that the instance is running on a S3 primary object storage, users might not be accurate</info>');
                      }
              
              
              Severity: Minor
              Found in core/Command/User/HomeListUsers.php - About 1 hr to fix

                Method openWithWeb has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function openWithWeb(?string $file_id, ?string $app_name): DataResponse {
                        $userAgent = $this->request->getHeader('User-Agent') ?? '-';
                        $this->logger->info("openWithWeb($file_id, $app_name) - $userAgent");
                        $fileId = $this->extractFileId($file_id);
                        $nodes = $this->rootFolder->getById($fileId, true);
                Severity: Minor
                Found in core/Controller/AppRegistryController.php - About 1 hr to fix

                  Method createShare has 11 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          $shareWith,
                          $name,
                          $description,
                          $providerId,
                          $owner,
                  Severity: Major
                  Found in apps/federatedfilesharing/lib/Controller/OcmController.php - About 1 hr to fix

                    Method sendMail has 11 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            $toaddress,
                            $toname,
                            $subject,
                            $mailtext,
                            $fromaddress,
                    Severity: Major
                    Found in lib/public/Util.php - About 1 hr to fix

                      Method getItems has 11 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              $itemType,
                              $item = null,
                              $shareType = null,
                              $shareWith = null,
                              $uidOwner = null,
                      Severity: Major
                      Found in lib/private/Share/Share.php - About 1 hr to fix

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

                                render: function() {
                                    var self = this;
                                    if (this._dialog) {
                                        // remove/destroy older instance
                                        this._dialog.model.off();
                        Severity: Minor
                        Found in apps/files_sharing/js/sharetabview.js - About 1 hr to fix

                          Function attach has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  attach: function (view) {
                                      var that = this;
                                      var baseRenderCall = view.render;
                          
                                      var shareCollectionModel = view.model.getLinkSharesCollection();
                          Severity: Minor
                          Found in apps/files_sharing/js/sharedialogview.js - About 1 hr to fix

                            Function reloadCallback has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    reloadCallback: function(result) {
                                        delete this._reloadCall;
                                        this.hideMask();
                            
                                        if (!result || result.status === 'error') {
                            Severity: Minor
                            Found in apps/files_trashbin/js/filelist.js - About 1 hr to fix

                              Function showAddExternalDialog has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  OCA.Sharing.showAddExternalDialog = function (share, passwordProtected, callback) {
                                      var remote = share.remote;
                                      var owner = share.ownerDisplayName || share.owner;
                                      var name = share.name;
                                      var remoteClean = (remote.substr(0, 8) === 'https://') ? remote.substr(8) : remote.substr(7);
                              Severity: Minor
                              Found in apps/files_sharing/js/external.js - About 1 hr to fix

                                Function _saveToOwnCloud has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    _saveToOwnCloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
                                        var that = this;
                                
                                        var toggleLoading = function () {
                                            var isLoading = !that.$saveToOcButton.find('#save-to-oc-button-loading').hasClass('hidden');
                                Severity: Minor
                                Found in apps/files_sharing/js/public.js - About 1 hr to fix

                                  Function actionHandler has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                                  actionHandler: function(fileName, context) {
                                                      var $actionEl = context.$file.find('.action-favorite');
                                                      var $file = context.$file;
                                                      var fileInfo = context.fileList.files[$file.index()];
                                                      var dir = context.dir || context.fileList.getCurrentDirectory();
                                  Severity: Minor
                                  Found in apps/files/js/tagsplugin.js - About 1 hr to fix

                                    Function triggerAction has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            triggerAction: function(actionName, fileInfoModel, fileList) {
                                                var actionFunc;
                                                var actions = this.get(
                                                    fileInfoModel.get('mimetype'),
                                                    fileInfoModel.isDirectory() ? 'dir' : 'file',
                                    Severity: Minor
                                    Found in apps/files/js/fileactions.js - About 1 hr to fix

                                      Function onPermissionChange has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              onPermissionChange: function(event) {
                                                  var $element = $(event.target);
                                                  var $li = $element.closest('li');
                                                  var shareId = $li.data('share-id');
                                                  var shareType = $li.data('share-type');
                                      Severity: Minor
                                      Found in core/js/sharedialogshareelistview.js - About 1 hr to fix

                                        Function joinPaths has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            joinPaths: function () {
                                                if (arguments.length < 1) {
                                                    return '';
                                                }
                                                var path = '';
                                        Severity: Minor
                                        Found in core/js/js.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language