owncloud/core

View on GitHub
apps/files/js/filelist.js

Summary

Maintainability
F
2 wks
Test Coverage

File filelist.js has 2297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2014
 *
 * This file is licensed under the Affero General Public License version 3
 * or later.
Severity: Major
Found in apps/files/js/filelist.js - About 6 days to fix

    Function rename has 144 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            rename: function(oldName) {
                var self = this;
                var tr, td, input, form;
                tr = this.findFileEl(oldName);
                var oldFileInfo = this.files[tr.index()];
    Severity: Major
    Found in apps/files/js/filelist.js - About 5 hrs to fix

      Function _createRow has 139 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _createRow: function(fileData, options) {
                  var td, simpleSize, basename, extension, sizeColor,
                      icon = fileData.icon || this._getIconUrl(fileData),
                      name = fileData.name,
                      // TODO: get rid of type, only use mime type
      Severity: Major
      Found in apps/files/js/filelist.js - About 5 hrs to fix

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

                initialize: function($el, options) {
                    var self = this;
                    options = options || {};
                    if (this.initialized) {
                        return;
        Severity: Major
        Found in apps/files/js/filelist.js - About 4 hrs to fix

          Function setupUploadEvents has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  setupUploadEvents: function(uploader) {
                      var self = this;
          
                      self._uploads = {};
          
          
          Severity: Major
          Found in apps/files/js/filelist.js - About 4 hrs to fix

            Function _onClickFile has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _onClickFile: function(event) {
                        this._setCurrentRow($(event.currentTarget).closest('tr'));
            
                        var $link = $(event.target).closest('a');
                        if ($link.attr('href') === '#' || $link.hasClass('disable-click')) {
            Severity: Major
            Found in apps/files/js/filelist.js - About 2 hrs to fix

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

                      reloadCallback: function(status, result) {
                          delete this._reloadCall;
                          this.hideMask();
              
                          if (status === 401) {
              Severity: Major
              Found in apps/files/js/filelist.js - About 2 hrs to fix

                Function _renderRow has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _renderRow: function(fileData, options) {
                            options = options || {};
                            var type = fileData.type || 'file',
                                mime = fileData.mimetype,
                                path = fileData.path || this.getCurrentDirectory(),
                Severity: Major
                Found in apps/files/js/filelist.js - About 2 hrs to fix

                  Function move has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          move: function(fileNames, targetPath) {
                              var self = this;
                              var dir = this.getCurrentDirectory();
                              if (dir.charAt(dir.length - 1) !== '/') {
                                  dir += '/';
                  Severity: Major
                  Found in apps/files/js/filelist.js - About 2 hrs 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 lazyLoadPreview has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              lazyLoadPreview : function(options) {
                                  var self = this;
                                  var path = options.path;
                                  var mime = options.mime;
                                  var ready = options.callback;
                      Severity: Minor
                      Found in apps/files/js/filelist.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 createDirectory has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  createDirectory: function(name) {
                                      var self = this;
                                      var deferred = $.Deferred();
                                      var promise = deferred.promise();
                          
                          
                          Severity: Minor
                          Found in apps/files/js/filelist.js - About 1 hr to fix

                            Function add has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    add: function(fileData, options) {
                                        var index = -1;
                                        var $tr;
                                        var $rows;
                                        var $insertionPoint;
                            Severity: Minor
                            Found in apps/files/js/filelist.js - About 1 hr to fix

                              Function createFile has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      createFile: function(name) {
                                          var self = this;
                                          var deferred = $.Deferred();
                                          var promise = deferred.promise();
                              
                              
                              Severity: Minor
                              Found in apps/files/js/filelist.js - About 1 hr to fix

                                Function getModelForFile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        getModelForFile: function(fileName) {
                                            var self = this;
                                            var $tr;
                                            // jQuery object ?
                                            if (fileName.is) {
                                Severity: Minor
                                Found in apps/files/js/filelist.js - About 1 hr to fix

                                  Function _setShareTreeUserGroupView has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          _setShareTreeUserGroupView: function() {
                                              var self  = this;
                                              var $list = $('<ul>', { id : 'shareTreeUserGroupList' });
                                  
                                              if (! _.keys(self._shareTreeCache).length > 0) {
                                  Severity: Minor
                                  Found in apps/files/js/filelist.js - About 1 hr to fix

                                    Function updateSelectionSummary has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            updateSelectionSummary: function() {
                                                var summary = this._selectionSummary.summary;
                                                var selection;
                                    
                                                var showHidden = !!this._filesConfig.get('showhidden');
                                    Severity: Minor
                                    Found in apps/files/js/filelist.js - About 1 hr to fix

                                      Function setSort has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              setSort: function(sort, direction, update, persist) {
                                                  var comparator = FileList.Comparators[sort] || FileList.Comparators.name;
                                                  this._sort = sort;
                                                  this._sortDirection = (direction === 'desc')?'desc':'asc';
                                                  this._sortComparator = comparator;
                                      Severity: Minor
                                      Found in apps/files/js/filelist.js - About 1 hr to fix

                                        Function _updateDetailsView has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                _updateDetailsView: function(fileName, show) {
                                                    if (!this._detailsView) {
                                                        return;
                                                    }
                                        
                                        
                                        Severity: Minor
                                        Found in apps/files/js/filelist.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 _setCurrentDir has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                    _setCurrentDir: function(targetDir, changeUrl, fileId) {
                                                        targetDir = targetDir.replace(/\\/g, '/');
                                                        if (!this._isValidPath(targetDir)) {
                                                            OC.Notification.show(t('files', 'Invalid path'), {type: 'error'});
                                                            targetDir = '/';
                                            Severity: Minor
                                            Found in apps/files/js/filelist.js - About 1 hr to fix

                                              Function getDirShareInfo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      getDirShareInfo: function(dir) {
                                                          // Dir can't be empty
                                                          if (typeof dir !== 'string' || dir.length === 0) {
                                                              return Promise.reject('getDirShareInfo(). param must be typeof string and can not be empty!');
                                                          }
                                              Severity: Minor
                                              Found in apps/files/js/filelist.js - About 1 hr to fix

                                                Function remove has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                        remove: function(name, options){
                                                            options = options || {};
                                                            var fileEl = this.findFileEl(name);
                                                            var fileId = fileEl.data('id');
                                                            var index = fileEl.index();
                                                Severity: Minor
                                                Found in apps/files/js/filelist.js - About 1 hr to fix

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

                                                          reload: function() {
                                                              this._selectedFiles = {};
                                                              this._selectionSummary.clear();
                                                              if (this._currentFileModel) {
                                                                  this._currentFileModel.off();
                                                  Severity: Minor
                                                  Found in apps/files/js/filelist.js - About 1 hr to fix

                                                    Function setFilter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                            setFilter:function(filter) {
                                                                var total = 0;
                                                                if (this._filter === filter) {
                                                                    return;
                                                                }
                                                    Severity: Minor
                                                    Found in apps/files/js/filelist.js - About 1 hr to fix

                                                      Function elementToFile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                              elementToFile: function($el){
                                                                  $el = $($el);
                                                                  var data = {
                                                                      id: parseInt($el.attr('data-id'), 10),
                                                                      name: $el.attr('data-file'),
                                                      Severity: Minor
                                                      Found in apps/files/js/filelist.js - About 1 hr to fix

                                                        Function _onDropOnBreadCrumb has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                                _onDropOnBreadCrumb: function( event, ui ) {
                                                                    var self = this;
                                                                    var $target = $(event.target);
                                                                    if (!$target.is('.crumb')) {
                                                                        $target = $target.closest('.crumb');
                                                        Severity: Minor
                                                        Found in apps/files/js/filelist.js - About 1 hr to fix

                                                          Function highlightFiles has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                                  highlightFiles: function(files, highlightFunction) {
                                                                      // Detection of the uploaded element
                                                                      var filename = files[files.length - 1];
                                                                      var $fileRow = this.findFileEl(filename);
                                                          
                                                          
                                                          Severity: Minor
                                                          Found in apps/files/js/filelist.js - About 1 hr to fix

                                                            Function _onClickDownloadSelected has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                    _onClickDownloadSelected: function(event) {
                                                                        var files;
                                                                        var dir = this.getCurrentDirectory();
                                                                        if (this.isAllSelected() && this.getSelectedFiles().length > 1) {
                                                                            files = OC.basename(dir);
                                                            Severity: Minor
                                                            Found in apps/files/js/filelist.js - About 1 hr to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                              return false;
                                                              Severity: Major
                                                              Found in apps/files/js/filelist.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                            return true;
                                                                Severity: Major
                                                                Found in apps/files/js/filelist.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                                  return true;
                                                                  Severity: Major
                                                                  Found in apps/files/js/filelist.js - About 30 mins to fix

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

                                                                                        $('<li class="shareTree-item">').append( $icon, $name, $path).appendTo($list).click(function() {
                                                                                            self.changeDirectory(share.path.replace(folder.name, ''), true).then(function() {
                                                                                                self._updateDetailsView(folder.name, true);
                                                                                            }).catch(function(e) {
                                                                                                console.error(e);
                                                                    Severity: Major
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 4 hrs to fix
                                                                    apps/files/js/filelist.js on lines 1976..1982

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

                                                                    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

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

                                                                                        $('<li class="shareTree-item">').append( $icon, $name, $path).appendTo($list).click(function() {
                                                                                            self.changeDirectory(share.path.replace(folder.name, ''), true).then(function() {
                                                                                                self._updateDetailsView(folder.name, true);
                                                                                            }).catch(function(e) {
                                                                                                console.error(e);
                                                                    Severity: Major
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 4 hrs to fix
                                                                    apps/files/js/filelist.js on lines 2014..2020

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

                                                                    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

                                                                                        self.addAndFetchFileInfo(targetPath, '', {scrollTo:true}).then(function(status, data) {
                                                                                            deferred.resolve(status, data);
                                                                                        }, function() {
                                                                                            OC.Notification.show(t('files', 'Could not create folder "{dir}"',
                                                                                                {dir: name}), {type: 'error'}
                                                                    Severity: Major
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 2 hrs to fix
                                                                    apps/files/js/filelist.js on lines 2537..2543

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

                                                                    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

                                                                                        self.addAndFetchFileInfo(targetPath, '', {scrollTo: true}).then(function(status, data) {
                                                                                            deferred.resolve(status, data);
                                                                                        }, function() {
                                                                                            OC.Notification.show(t('files', 'Could not create file "{file}"',
                                                                                                {file: name}), {type: 'error'}
                                                                    Severity: Major
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 2 hrs to fix
                                                                    apps/files/js/filelist.js on lines 2587..2593

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

                                                                    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

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

                                                                                td.append($('<span></span>').attr({
                                                                                    "class": "modified",
                                                                                    "title": formatted,
                                                                                    "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')'
                                                                                }).text(text)
                                                                    Severity: Major
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 2 hrs to fix
                                                                    apps/files_sharing/js/sharedfilelist.js on lines 126..132

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

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

                                                                                    try {
                                                                                        var newName = input.val().trim();
                                                                                        input.tooltip('hide');
                                                                                        form.remove();
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in apps/files/js/filelist.js and 2 other locations - About 2 hrs to fix
                                                                    apps/files/js/filelist.js on lines 2479..2489
                                                                    apps/files/js/newfilemenu.js on lines 156..170

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

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

                                                                                    try {
                                                                                        checkInput();
                                                                                        input.tooltip('hide');
                                                                                        input.removeClass('error');
                                                                                    } catch (error) {
                                                                    Severity: Major
                                                                    Found in apps/files/js/filelist.js and 2 other locations - About 2 hrs to fix
                                                                    apps/files/js/filelist.js on lines 2384..2474
                                                                    apps/files/js/newfilemenu.js on lines 156..170

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

                                                                    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

                                                                                if (files.length === 0) {
                                                                                    // single one selected without checkbox?
                                                                                    files = _.map(ui.helper.find('tr'), function(el) {
                                                                                        return self.elementToFile($(el));
                                                                                    });
                                                                    Severity: Major
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 1 hr to fix
                                                                    apps/files/js/files.js on lines 473..478

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

                                                                    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

                                                                                                .fail(function() {
                                                                                                    OC.Notification.show(t('files', 'Could not create folder "{dir}"',
                                                                                                        {dir: name}), {type: 'error'}
                                                                                                    );
                                                                                                    deferred.reject(status);
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 40 mins to fix
                                                                    apps/files/js/filelist.js on lines 2670..2675

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

                                                                    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

                                                                                    .fail(function(status) {
                                                                                        OC.Notification.show(t('files', 'Could not create file "{file}"',
                                                                                            {file: name}), {type: 'error'}
                                                                                        );
                                                                                        deferred.reject(status);
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 40 mins to fix
                                                                    apps/files/js/filelist.js on lines 2607..2612

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

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

                                                                                            } else if (status === 423) {
                                                                                                OC.Notification.show(t('files', 'Could not move "{file}" because either the file or the target are locked.',
                                                                                                    {file: fileName, message: result.message}), {type: 'error'}
                                                                                                );
                                                                                            } else if (status === 507) {
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 2 other locations - About 35 mins to fix
                                                                    apps/files/js/filelist.js on lines 2285..2297
                                                                    apps/files/js/filelist.js on lines 2289..2297

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

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

                                                                                            } else if (result != null && typeof result.message !== "undefined") {
                                                                                                OC.Notification.show(t('files', 'Could not move "{file}": {message}',
                                                                                                    {file: fileName, message: result.message}), {type: 'error'}
                                                                                                );
                                                                                            } else {
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 2 other locations - About 35 mins to fix
                                                                    apps/files/js/filelist.js on lines 2281..2297
                                                                    apps/files/js/filelist.js on lines 2285..2297

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

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

                                                                                            } else if (status === 507) {
                                                                                                OC.Notification.show(t('files', 'Not enough free space',
                                                                                                    {file: fileName, message: result.message}), {type: 'error'}
                                                                                                );
                                                                                            } else if (result != null && typeof result.message !== "undefined") {
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 2 other locations - About 35 mins to fix
                                                                    apps/files/js/filelist.js on lines 2281..2297
                                                                    apps/files/js/filelist.js on lines 2289..2297

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

                                                                    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

                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                                if (this._detailsView && !this._detailsView.$el.hasClass('disappear')) {
                                                                                    // hide sidebar
                                                                                    this._updateDetailsView(null);
                                                                                }
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 2 other locations - About 35 mins to fix
                                                                    apps/files/js/filelist.js on lines 635..638
                                                                    apps/files/js/filelist.js on lines 763..766

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

                                                                    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

                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                                if (this._detailsView && !this._detailsView.$el.hasClass('disappear')) {
                                                                                    // hide sidebar
                                                                                    this._updateDetailsView(null);
                                                                                }
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 2 other locations - About 35 mins to fix
                                                                    apps/files/js/filelist.js on lines 635..638
                                                                    apps/files/js/filelist.js on lines 735..738

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

                                                                    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

                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                    Open

                                                                                if (this._detailsView && !this._detailsView.$el.hasClass('disappear')) {
                                                                                    // hide sidebar
                                                                                    this._updateDetailsView(null);
                                                                                }
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 2 other locations - About 35 mins to fix
                                                                    apps/files/js/filelist.js on lines 735..738
                                                                    apps/files/js/filelist.js on lines 763..766

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

                                                                    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 = 0; i < parts.length; i++) {
                                                                                    encoded.push(encodeURIComponent(parts[i]));
                                                                                }
                                                                    Severity: Minor
                                                                    Found in apps/files/js/filelist.js and 1 other location - About 35 mins to fix
                                                                    core/js/js.js on lines 364..366

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

                                                                    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

                                                                    There are no issues that match your filters.

                                                                    Category
                                                                    Status