talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

        return this.each(function(i){
            // Set all the styles
            for ( name in options )
                jQuery.attr(
                    type ?
Severity: Major
Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 1 hr to fix
app/assets/javascripts/jquery.js on lines 182..191

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

    onShow : function(){
        if(this.isCollapsed){
            this.getCollapsedEl().show();
        }else if(this.splitEl){
            this.splitEl.show();
app/assets/javascripts/ext/src/widgets/layout/BorderLayout.js on lines 590..596

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

    onHide : function(){
        if(this.isCollapsed){
            this.getCollapsedEl().hide();
        }else if(this.splitEl){
            this.splitEl.hide();
app/assets/javascripts/ext/src/widgets/layout/BorderLayout.js on lines 599..605

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

    onEnable : function(){
        Ext.form.ComboBox.superclass.onEnable.apply(this, arguments);
        if(this.hiddenField){
            this.hiddenField.disabled = false;
        }
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/form/Combo.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ext/src/widgets/form/Combo.js on lines 875..880

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

    onDisable : function(){
        Ext.form.ComboBox.superclass.onDisable.apply(this, arguments);
        if(this.hiddenField){
            this.hiddenField.disabled = true;
        }
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/form/Combo.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ext/src/widgets/form/Combo.js on lines 867..872

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

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

                    success: function(form, action){
                        this.loaded_data = action.result.data;

                        // set up audience panel and permissions selections here
                        var rg = this.getComponent('tp').getComponent('sh').getComponent('rh').getComponent('rg');
Severity: Minor
Found in app/assets/javascripts/documents/AddEditFolderWindow.js - About 1 hr to fix

    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 add has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          add: function(elem, types, handler, data) {
              if ( elem.nodeType == 3 || elem.nodeType == 8 )
                  return;
      
              // For whatever reason, IE has trouble passing the window object
      Severity: Minor
      Found in app/assets/javascripts/jquery.js - About 1 hr to fix

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

                restify : function(proxy) {
                    proxy.restful = true;
                    for (var verb in this.restActions) {
                        proxy.api[this.actions[verb]].method ||
                            (proxy.api[this.actions[verb]].method = this.restActions[verb]);
        Severity: Minor
        Found in app/assets/javascripts/ext/src/data/Api.js - About 1 hr to fix

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

              updateExpandIcon : function(){
                  if(this.rendered){
                      var n = this.node,
                          c1,
                          c2,
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/tree/TreeNodeUI.js - About 1 hr to fix

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

                renderItem : function(c, position, target){
                    if(c && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){
                        var args = this.getTemplateArgs(c);
                        if(Ext.isNumber(position)){
                            position = target.dom.childNodes[position] || null;
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/layout/FormLayout.js - About 1 hr to fix

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

                  onEditorKey : function(field, e){
                      var k = e.getKey(), 
                          newCell, 
                          g = this.grid, 
                          last = g.lastEdit,
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/grid/RowSelectionModel.js - About 1 hr to fix

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

                    layout : function(initial) {
                        if (!this.mainBody) {
                            return; // not rendered
                        }
                
                
                Severity: Minor
                Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                      showMenu : function(item) {
                          var menu = item.child('ul'),
                              x = y = 0;
                  
                          item.select('>a').addClass('ux-menu-link-hover');
                  Severity: Minor
                  Found in app/assets/javascripts/ext/src/ext-core/examples/menu/menu.js - About 1 hr to fix

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

                        switchOff : function(o){
                            o = getObject(o);
                            var me = this,
                                dom = me.dom,
                                st = dom.style,
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/ext-core/src/core/Fx.js - About 1 hr to fix

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

                          expandRow : function(record, skip_process)
                          {
                              var ds = this.ds,
                                  i, len, row, pmel, children, index, child_index;
                              
                      Severity: Minor
                      Found in app/assets/javascripts/ext_extensions/TreeGrid/src/GridView.js - About 1 hr to fix

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

                            expandRow : function(record, skip_process)
                            {
                                var ds = this.ds,
                                    i, len, row, pmel, children, index, child_index;
                                
                        Severity: Minor
                        Found in app/assets/javascripts/ext_extensions/TreeGrid/TreeGrid.js - About 1 hr to fix

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

                            markupText: function(text, r){
                              var entities = r['entities'],
                                  replacements = [],
                                  out_text = '',
                                  end_i;
                          Severity: Minor
                          Found in app/assets/javascripts/dashboard/cms/portlets/twitter.js - About 1 hr to fix

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

                              constructor: function(config){
                                Ext.apply(this, config);
                                
                                this.dashboard_id = Application.default_dashboard
                                
                            Severity: Minor
                            Found in app/assets/javascripts/dashboard/cms/view_controller.js - About 1 hr to fix

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

                                  _createInput: function(){                
                                      var input = document.createElement("input");
                                      
                                      if (this._options.multiple){
                                          input.setAttribute("multiple", "multiple");
                              Severity: Minor
                              Found in app/assets/javascripts/lib/fileuploader.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language