talho/openphin

View on GitHub
app/assets/javascripts/documents/Documents.js

Summary

Maintainability
F
1 wk
Test Coverage

Function _setFileControlsState has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    _setFileControlsState: function(control){
        if(!this._fileControls){
            this._fileControls = this.getPanel().getComponent('file_grid_holder').getComponent('file_icon_holder').getComponent('file_controls');
        }
        if(!this._add_folder_button){
Severity: Minor
Found in app/assets/javascripts/documents/Documents.js - About 7 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File Documents.js has 428 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//= require ext_extensions/xActionColumn
//= require ext_extensions/SubmitFalse
//= require ext_extensions/ImageDisplayField
//= require ./AddEditFolderWindow
//= require ./DocumentViews
Severity: Minor
Found in app/assets/javascripts/documents/Documents.js - About 6 hrs to fix

    Function _createFolderTreeGrid has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        _createFolderTreeGrid: function(){
            return this._folderTreeGrid =  new Ext.ux.maximgb.tg.GridPanel({
                title: 'Folders',
                frame: true,
                region: 'center',
    Severity: Minor
    Found in app/assets/javascripts/documents/Documents.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function _createFolderTreeGrid has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _createFolderTreeGrid: function(){
            return this._folderTreeGrid =  new Ext.ux.maximgb.tg.GridPanel({
                title: 'Folders',
                frame: true,
                region: 'center',
    Severity: Major
    Found in app/assets/javascripts/documents/Documents.js - About 3 hrs to fix

      Function _setFileControlsState has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _setFileControlsState: function(control){
              if(!this._fileControls){
                  this._fileControls = this.getPanel().getComponent('file_grid_holder').getComponent('file_icon_holder').getComponent('file_controls');
              }
              if(!this._add_folder_button){
      Severity: Major
      Found in app/assets/javascripts/documents/Documents.js - About 3 hrs to fix

        Function _createFileIconView has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _createFileIconView: function(store){
        
                return {
                    xtype: 'panel',
                    title: 'Files',
        Severity: Major
        Found in app/assets/javascripts/documents/Documents.js - About 2 hrs to fix

          Function _createFileGrid has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _createFileGrid: function(store){
                  return {
                      xtype: 'grid',
                      title: 'Files',
                      itemId: 'file_grid',
          Severity: Major
          Found in app/assets/javascripts/documents/Documents.js - About 2 hrs to fix

            Function _createFileIconView has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                _createFileIconView: function(store){
            
                    return {
                        xtype: 'panel',
                        title: 'Files',
            Severity: Minor
            Found in app/assets/javascripts/documents/Documents.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                                'dblclick': function(gv, index){
                                    var store = gv.getStore();
                                    var rec = store.getAt(index);
                                    if(rec.get('type') == 'folder'){
                                        // open this folder in the view by selecting it in the folder list
            Severity: Minor
            Found in app/assets/javascripts/documents/Documents.js - About 1 hr to fix

              Function rowselect has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                                  'rowselect': function(sm, row, record){
                                      if(!this._fileGrid){
                                          this._fileGrid = this.getPanel().getComponent('file_grid_holder').getComponent('file_grid');
                                      }
                                      if(!this._iconView){
              Severity: Minor
              Found in app/assets/javascripts/documents/Documents.js - About 1 hr to fix

                Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    constructor: function(config){
                        Ext.apply(this, config);
                
                        var blank_store = new Ext.data.Store({});
                
                
                Severity: Minor
                Found in app/assets/javascripts/documents/Documents.js - About 1 hr to fix

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

                      showFiles: function(record){
                          var store = new Talho.ux.Documents.FileStore({
                              url: '/folders/' + record.get('id') + '.json',
                              autoLoad: true,
                              listeners: {
                  Severity: Minor
                  Found in app/assets/javascripts/documents/Documents.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if(sel.get('is_owner')){
                                            show.push('folder_action_container', 'move_action_container');
                                            this._add_folder_button.show();
                                        }
                    Severity: Major
                    Found in app/assets/javascripts/documents/Documents.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if(folderSelections[0] && folderSelections[0].get('type').match(/share|organization/)){  // we want to figure out what sharing permissions we have, eventually, but for now, roll with it
                                              show.push('copy_action_container', 'file_detail_container');
                                              if(folderSelections[0].get('is_owner')){
                                                  show.push('move_action_container');
                                              }
                      Severity: Major
                      Found in app/assets/javascripts/documents/Documents.js - About 45 mins to fix

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

                                            this._fileControls.applySectionDetails('folder_detail_container', {
                                                'name': sel.get('name'),
                                                'image': Talho.ux.Documents.mimeToImageClass('folder'),
                                                'created_at': Ext.util.Format.date(sel.get('created_at'), 'n/j/y h:i A'),
                                                'updated_at': Ext.util.Format.date(sel.get('updated_at'), 'n/j/y h:i A')
                        Severity: Major
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 3 hrs to fix
                        app/assets/javascripts/documents/Documents.js on lines 416..421

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

                        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

                                            this._fileControls.applySectionDetails('folder_detail_container', {
                                                'name': sel.get('name'),
                                                'image': Talho.ux.Documents.mimeToImageClass('folder'),
                                                'created_at': Ext.util.Format.date(sel.get('created_at'), 'n/j/y h:i A'),
                                                'updated_at': Ext.util.Format.date(sel.get('updated_at'), 'n/j/y h:i A')
                        Severity: Major
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 3 hrs to fix
                        app/assets/javascripts/documents/Documents.js on lines 429..434

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

                        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

                                    tools: [{id: 'icon-view', scope: this, qtip: 'Icon View', handler: function(){
                                        this.getPanel().getComponent('file_grid_holder').layout.setActiveItem(0);
                                        this.getPanel().doLayout();
                                    }}],
                        Severity: Major
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 2 hrs to fix
                        app/assets/javascripts/documents/Documents.js on lines 311..316

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

                        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

                                    tools: [
                                        {id: 'detail-view', scope: this, qtip: 'Detail View', handler: function(){
                                            this.getPanel().getComponent('file_grid_holder').layout.setActiveItem(1);
                                            this.getPanel().doLayout();
                                        }}
                        Severity: Major
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 2 hrs to fix
                        app/assets/javascripts/documents/Documents.js on lines 216..219

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

                        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

                                                if(!this._iconView){
                                                    this._iconView = this.getPanel().getComponent('file_grid_holder').getComponent('file_icon_holder').getComponent('file_icon_view');
                                                }
                        Severity: Major
                        Found in app/assets/javascripts/documents/Documents.js and 2 other locations - About 1 hr to fix
                        app/assets/javascripts/documents/Documents.js on lines 163..165
                        app/assets/javascripts/documents/Documents.js on lines 369..371

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

                        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

                                if(!this._fileControls){
                                    this._fileControls = this.getPanel().getComponent('file_grid_holder').getComponent('file_icon_holder').getComponent('file_controls');
                                }
                        Severity: Major
                        Found in app/assets/javascripts/documents/Documents.js and 2 other locations - About 1 hr to fix
                        app/assets/javascripts/documents/Documents.js on lines 101..103
                        app/assets/javascripts/documents/Documents.js on lines 163..165

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

                        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

                                             if(!this._iconView){
                                                this._iconView = this.getPanel().getComponent('file_grid_holder').getComponent('file_icon_holder').getComponent('file_icon_view');
                                             }
                        Severity: Major
                        Found in app/assets/javascripts/documents/Documents.js and 2 other locations - About 1 hr to fix
                        app/assets/javascripts/documents/Documents.js on lines 101..103
                        app/assets/javascripts/documents/Documents.js on lines 369..371

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

                        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

                                    items.push({itemId: 'delete', text: 'Delete Folder', iconCls: 'documents-delete-folder-icon', handler: this.file_actions.deleteItem, scope: this.file_actions});
                        Severity: Minor
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 40 mins to fix
                        app/assets/javascripts/documents/Documents.js on lines 355..355

                        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

                                        items.push({itemId: 'move', text: 'Move Folder', iconCls: 'documents-move-icon', handler: this.file_actions.moveItem, scope: this.file_actions});
                        Severity: Minor
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 40 mins to fix
                        app/assets/javascripts/documents/Documents.js on lines 356..356

                        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

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

                                                          Ext.EventManager.on(this._downloadFrame, 'load', function(){
                                                              // in a very strange bit of convenience, the frame load event will only fire here IF there is an error
                                                              // need to test the convenience on IE.
                                                              Ext.Msg.alert('Could Not Load File', 'There was an error downloading the file you have requested. Please contact an administrator');
                                                          }, this);
                        Severity: Minor
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 35 mins to fix
                        app/assets/javascripts/documents/DocumentViews.js on lines 252..256

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

                        Talho.Documents.initializer = function(config){
                            var documents = new Talho.Documents(config);
                            return documents.getPanel();
                        };
                        Severity: Major
                        Found in app/assets/javascripts/documents/Documents.js and 14 other locations - About 35 mins to fix
                        app/assets/javascripts/admin/AddUser.js on lines 83..86
                        app/assets/javascripts/admin/AuditLog.js on lines 236..239
                        app/assets/javascripts/admin/BatchUsers.js on lines 213..216
                        app/assets/javascripts/admin/EditUsers.js on lines 182..185
                        app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
                        app/assets/javascripts/dashboard/tutorials.js on lines 35..39
                        app/assets/javascripts/invitations/Invitations.js on lines 413..416
                        app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
                        app/assets/javascripts/profile/EditDevices.js on lines 47..50
                        app/assets/javascripts/profile/EditPassword.js on lines 24..27
                        app/assets/javascripts/profile/EditProfile.js on lines 139..142
                        app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
                        app/assets/javascripts/profile/ManageRoles.js on lines 48..51
                        app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

                        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

                                    items.push({itemId:'edit', text:'Edit Folder', iconCls: 'documents-edit-folder-icon', handler: this.file_actions.createNewFolder.createDelegate(this.file_actions, ['edit'])});
                        Severity: Minor
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 35 mins to fix
                        app/assets/javascripts/documents/DocumentViews.js on lines 350..350

                        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

                                this.file_actions = new Talho.ux.Documents.FileActions({listeners: {
                                    scope: this,
                                    'refresh': this._refresh
                                }});
                        Severity: Minor
                        Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 35 mins to fix
                        app/assets/javascripts/groups/ManageGroups.js on lines 76..81

                        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