owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function send has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        send: function (data) {
            if (data && !this.options.disabled) {
                if (data.fileInput && !data.files) {
                    var that = this,
                        dfd = $.Deferred(),
Severity: Minor
Found in apps/files/js/jquery.fileupload.js - About 1 hr to fix

    Function _nextPage has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _nextPage: function(animate) {
                var index = this.$fileList.children().length,
                    count = this.pageSize(),
                    hidden,
                    tr,
    Severity: Minor
    Found in apps/files/js/filelist.js - About 1 hr to fix

      Function show has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              show: function() {
                  var self = this;
                  var title = t('core', 'Edit link share: {name}', {name: this.itemModel.getFileInfo().getFullPath()});
                  var buttons = [{
                      text: t('core', 'Cancel'),
      Severity: Minor
      Found in core/js/sharedialoglinkshareview.js - About 1 hr to fix

        Function _fillFilePicker has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _fillFilePicker:function(dir) {
                var dirs = [];
                var others = [];
                var self = this;
                this.$filelist.empty().addClass('icon-loading');
        Severity: Minor
        Found in core/js/oc-dialogs.js - About 1 hr to fix

          Function prompt has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              prompt: function (text, title, callback, modal, name, password, buttonDeclineText, buttonConfirmText) {
                  return $.when(this._getMessageTemplate()).then(function ($tmpl) {
                      var dialogName = 'oc-dialog-' + OCdialogs.dialogsCounter + '-content';
                      var dialogId = '#' + dialogName;
                      var $dlg = $tmpl.octemplate({
          Severity: Minor
          Found in core/js/oc-dialogs.js - About 1 hr to fix

            Method tryHttpPostToShareEndpoint has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $useOcm = false) {
                    $client = $this->httpClientService->newClient();
                    $protocol = 'https://';
                    $result = [
                        'success' => false,
            Severity: Minor
            Found in apps/federatedfilesharing/lib/Notifications.php - About 1 hr to fix

              Method getPublicCalendar has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getPublicCalendar($uri) {
                      $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 updateProperties has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function updateProperties($path, INode $node, $changedProperties) {
                        $existingProperties = $this->getProperties($path, $node, []);
                        '@phan-var \OCA\DAV\Connector\Sabre\Node $node';
                        $fileId = $node->getId();
                
                
                Severity: Minor
                Found in apps/dav/lib/DAV/FileCustomPropertiesBackend.php - About 1 hr to fix

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

                      public function __construct(array $urlParams= []) {
                          parent::__construct('files', $urlParams);
                          $container = $this->getContainer();
                          $server = $container->getServer();
                  
                  
                  Severity: Minor
                  Found in apps/files/lib/AppInfo/Application.php - About 1 hr to fix

                    Method showFile has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function showFile($fileId, $details = null) {
                            $uid = $this->userSession->getUser()->getUID();
                            $baseFolder = $this->rootFolder->get($uid . '/files/');
                            '@phan-var \OCP\Files\Folder $baseFolder';
                            $files = $baseFolder->getById($fileId);
                    Severity: Minor
                    Found in apps/files/lib/Controller/ViewController.php - About 1 hr to fix

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

                          public function __construct(
                              $globalPrefix,
                              ILogger $logger,
                              $localCacheClass = null,
                              $distributedCacheClass = null,
                      Severity: Minor
                      Found in lib/private/Memcache/Factory.php - About 1 hr to fix

                        Method hasUpdated has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function hasUpdated($path, $time) {
                                $this->init();
                                $path = $this->cleanPath($path);
                                try {
                                    // force refresh for $path
                        Severity: Minor
                        Found in lib/private/Files/Storage/DAV.php - About 1 hr to fix

                          Method getThumbnail has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getThumbnail(File $file, $maxX, $maxY, $scalingUp) {
                                  $stream = $file->fopen('r');
                                  $content = \stream_get_contents($stream, 2048);
                                  \fclose($stream);
                          
                          
                          Severity: Minor
                          Found in lib/private/Preview/TXT.php - About 1 hr to fix

                            Method getAllSharedWith has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getAllSharedWith($userId, $node) {
                                    // Create array of sharedWith objects (target user -> $userId or group of which user is a member
                                    $user = $this->userManager->get($userId);
                            
                                    // Check if user is member of some groups and chunk them
                            Severity: Minor
                            Found in lib/private/Share20/DefaultShareProvider.php - About 1 hr to fix

                              Method createConnectionParams has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function createConnectionParams() {
                                      $type = $this->config->getValue('dbtype', 'sqlite');
                              
                                      $connectionParams = [
                                          'user' => $this->config->getValue('dbuser', ''),
                              Severity: Minor
                              Found in lib/private/DB/ConnectionFactory.php - About 1 hr to fix

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                    public function __construct(
                                        IGroupManager $groupManager,
                                        IManager $activityManager,
                                        IUserSession $session,
                                        ISystemTagManager $tagManager,
                                Severity: Major
                                Found in apps/systemtags/lib/Activity/Listener.php and 4 other locations - About 1 hr to fix
                                apps/federatedfilesharing/lib/FedShareManager.php on lines 88..104
                                apps/federation/lib/TrustedServers.php on lines 77..93
                                lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 76..92
                                lib/private/Repair/MoveAvatarOutsideHome.php on lines 77..93

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 116.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                    public function __construct(
                                        DbHandler $dbHandler,
                                        IClientService $httpClientService,
                                        ILogger $logger,
                                        IJobList $jobList,
                                Severity: Major
                                Found in apps/federation/lib/TrustedServers.php and 4 other locations - About 1 hr to fix
                                apps/federatedfilesharing/lib/FedShareManager.php on lines 88..104
                                apps/systemtags/lib/Activity/Listener.php on lines 67..83
                                lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 76..92
                                lib/private/Repair/MoveAvatarOutsideHome.php on lines 77..93

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 116.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                    public function __construct(
                                        IConfig $config,
                                        IDBConnection $connection,
                                        IUserManager $userManager,
                                        IAvatarManager $avatarManager,
                                Severity: Major
                                Found in lib/private/Repair/MoveAvatarOutsideHome.php and 4 other locations - About 1 hr to fix
                                apps/federatedfilesharing/lib/FedShareManager.php on lines 88..104
                                apps/federation/lib/TrustedServers.php on lines 77..93
                                apps/systemtags/lib/Activity/Listener.php on lines 67..83
                                lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 76..92

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 116.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                    public function __construct(
                                        IConfig $config,
                                        IDBConnection $connection,
                                        IUserManager $userManager,
                                        IAvatarManager $avatarManager,
                                Severity: Major
                                Found in lib/private/Repair/MoveAvatarIntoSubFolder.php and 4 other locations - About 1 hr to fix
                                apps/federatedfilesharing/lib/FedShareManager.php on lines 88..104
                                apps/federation/lib/TrustedServers.php on lines 77..93
                                apps/systemtags/lib/Activity/Listener.php on lines 67..83
                                lib/private/Repair/MoveAvatarOutsideHome.php on lines 77..93

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 116.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                    public function __construct(
                                        FederatedShareProvider $federatedShareProvider,
                                        Notifications $notifications,
                                        IUserManager $userManager,
                                        ActivityManager $activityManager,
                                Severity: Major
                                Found in apps/federatedfilesharing/lib/FedShareManager.php and 4 other locations - About 1 hr to fix
                                apps/federation/lib/TrustedServers.php on lines 77..93
                                apps/systemtags/lib/Activity/Listener.php on lines 67..83
                                lib/private/Repair/MoveAvatarIntoSubFolder.php on lines 76..92
                                lib/private/Repair/MoveAvatarOutsideHome.php on lines 77..93

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 116.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Severity
                                Category
                                Status
                                Source
                                Language