owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function reload has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        reload: function() {
            this.showMask();
            if (this._reloadCall) {
                this._reloadCall.abort();
            }
Severity: Minor
Found in apps/files_sharing/js/sharedfilelist.js - About 1 hr to fix

    Function applyGroupSelect has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        applyGroupSelect: function (element, user, checked) {
            var $element = $(element);
    
            var checkHandler = null;
            if(user) { // Only if in a user row, and not the #newusergroups select
    Severity: Minor
    Found in settings/js/users/users.js - About 1 hr to fix

      Function getFilteredFiles has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              getFilteredFiles: function(filter, options) {
                  options = options || {};
                  var self = this;
                  var deferred = $.Deferred();
                  var promise = deferred.promise();
      Severity: Minor
      Found in core/js/files/client.js - About 1 hr to fix

        Function autocompleteRenderItem has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                autocompleteRenderItem: function(ul, item) {
                    var text = item.label;
                    var showIcon = false;
                    var iconClass = "";
                    var typeInfo = t('core', 'User');
        Severity: Minor
        Found in core/js/sharedialogview.js - About 1 hr to fix

          Function _create has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _create: function() {
                      var self = this;
          
                      this.originalTitle = this.element.attr('title');
                      this.options.title = this.options.title || this.originalTitle;
          Severity: Minor
          Found in core/js/jquery.ocdialog.js - About 1 hr to fix

            Method setupFromToken has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function setupFromToken($token, $relativePath = null, $password = null) {
                    \OC_User::setIncognitoMode(true);
            
                    $linkItem = \OCP\Share::getShareByToken($token, !$password);
                    if ($linkItem === false || ($linkItem['item_type'] !== 'file' && $linkItem['item_type'] !== 'folder')) {
            Severity: Minor
            Found in apps/files_sharing/lib/Helper.php - About 1 hr to fix

              Method handleUpdateProperties has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function handleUpdateProperties($path, PropPatch $propPatch) {
                      $node = $this->server->tree->getNodeForPath($path);
                      if (!($node instanceof SystemTagNode)) {
                          return;
                      }
              Severity: Minor
              Found in apps/dav/lib/SystemTag/SystemTagPlugin.php - About 1 hr to fix

                Method save has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function save() {
                        if (\is_array($this->tags)) {
                            foreach ($this->tags as $tag) {
                                try {
                                    if (!$this->mapper->tagExists($tag)) {
                Severity: Minor
                Found in lib/private/Tags.php - About 1 hr to fix

                  Method post_deleteUser has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function post_deleteUser($arguments) {
                          // Find all objectid/tagId pairs.
                          $result = null;
                          try {
                              $stmt = \OCP\DB::prepare('SELECT `id` FROM `' . self::TAG_TABLE . '` '
                  Severity: Minor
                  Found in lib/private/Tags.php - About 1 hr to fix

                    Method getShareByToken has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getShareByToken($token) {
                            $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);
                    
                            try {
                                $share = $provider->getShareByToken($token);
                    Severity: Minor
                    Found in lib/private/Share20/Manager.php - About 1 hr to fix

                      Method resizeAndStore has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function resizeAndStore() {
                              $image = $this->preview;
                              if (!($image instanceof IImage)) {
                                  Util::writeLog(
                                      'core',
                      Severity: Minor
                      Found in lib/private/Preview.php - About 1 hr to fix

                        Method checkTokenCredentials has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function checkTokenCredentials(IToken $dbToken, $token) {
                                // Check whether login credentials are still valid and the user was not disabled
                                // This check is performed each 5 minutes per default
                                // However, we try to read last_check_timeout from the appconfig table so the
                                // administrator could change this 5 minutes timeout
                        Severity: Minor
                        Found in lib/private/User/Session.php - About 1 hr to fix

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

                                  for(var i in groups) {
                                      var gid = groups[i]['gid'];
                                      var $li = GroupList.getGroupLI(gid);
                                      var userCount = GroupList.getUserCount($li);
                                      GroupList.setUserCount($li, userCount - 1);
                          Severity: Major
                          Found in settings/js/users/users.js and 1 other location - About 1 hr to fix
                          settings/js/users/users.js on lines 320..325

                          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 74.

                          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 2 locations. Consider refactoring.
                          Open

                                  for(var i in groups) {
                                      var gid = groups[i]['gid'];
                                      var $li = GroupList.getGroupLI(gid);
                                      var userCount = GroupList.getUserCount($li);
                                      GroupList.setUserCount($li, userCount + 1);
                          Severity: Major
                          Found in settings/js/users/users.js and 1 other location - About 1 hr to fix
                          settings/js/users/users.js on lines 305..310

                          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 74.

                          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 2 locations. Consider refactoring.
                          Open

                          <?php
                          namespace OC\Migrations;
                          
                          use Doctrine\DBAL\Schema\Schema;
                          use Doctrine\DBAL\Types\Type;
                          Severity: Major
                          Found in core/Migrations/Version20240112140951.php and 1 other location - About 1 hr to fix
                          core/Migrations/Version20170711191432.php on lines 1..25

                          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 120.

                          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 2 locations. Consider refactoring.
                          Open

                          <?php
                          namespace OC\Migrations;
                          
                          use Doctrine\DBAL\Schema\Schema;
                          use Doctrine\DBAL\Types\Type;
                          Severity: Major
                          Found in core/Migrations/Version20170711191432.php and 1 other location - About 1 hr to fix
                          core/Migrations/Version20240112140951.php on lines 1..25

                          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 120.

                          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

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

                                  render: function() {
                                      var self = this;
                                      this.$el.html(this.template());
                          
                                      this.$el.find('[title]').tooltip({placement: 'bottom'});
                          Severity: Minor
                          Found in core/js/systemtags/systemtagsinputfield.js - About 1 hr to fix

                            Function do_delete has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    do_delete:function(files, dir) {
                                        var self = this;
                                        if (files && files.substr) {
                                            files=[files];
                                        }
                            Severity: Minor
                            Found in apps/files/js/filelist.js - About 1 hr to fix

                              Function addShare has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      addShare: function(properties, options) {
                                          var shareType = properties.shareType;
                                          options = options || {};
                                          properties = _.extend({}, properties);
                              
                              
                              Severity: Minor
                              Found in core/js/shareitemmodel.js - About 1 hr to fix

                                Function initialize has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        initialize: function() {
                                            this.navigation = new OCA.Files.Navigation($('#app-navigation'));
                                            this.$showHiddenFiles = $('input#showhiddenfilesToggle');
                                            var showHidden = $('#showHiddenFiles').val() === "1";
                                            this.$showHiddenFiles.prop('checked', showHidden);
                                Severity: Minor
                                Found in apps/files/js/app.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language