talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

      message = "That resource does not exist or you do not have access to it."
      if request.xhr?
        respond_to do |format|
          format.html {render :text => message, :status => 404}
          format.json {render :json => {:message => message}, :status => 404}
Severity: Major
Found in app/controllers/application_controller.rb and 3 other locations - About 40 mins to fix
app/controllers/application_controller.rb on lines 110..120
app/controllers/application_controller.rb on lines 126..136
app/controllers/application_controller.rb on lines 143..153

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

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

      message = "That resource does not exist or you do not have access to it."
      if request.xhr?
        respond_to do |format|
          format.html {render :text => message, :status => 404}
          format.json {render :json => {:message => message}, :status => 404}
Severity: Major
Found in app/controllers/application_controller.rb and 3 other locations - About 40 mins to fix
app/controllers/application_controller.rb on lines 126..136
app/controllers/application_controller.rb on lines 143..153
app/controllers/application_controller.rb on lines 159..169

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

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

      message = "That resource does not exist or you do not have access to it."
      if request.xhr?
        respond_to do |format|
          format.html {render :text => message, :status => 404}
          format.json {render :json => {:message => message}, :status => 404}
Severity: Major
Found in app/controllers/application_controller.rb and 3 other locations - About 40 mins to fix
app/controllers/application_controller.rb on lines 110..120
app/controllers/application_controller.rb on lines 126..136
app/controllers/application_controller.rb on lines 159..169

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

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

Consider simplifying this complex logical expression.
Open

        if(audience && audience.users.length < 1 && (
                (ap.rendered && this.getComponent('tp').getComponent('sh').getComponent('rh').getComponent('rg').getValue().getRawValue() === 'shared') ||
                (this.loaded_data && this.loaded_data['folder[shared]'] == 'shared'))){
          this.getComponent('tp').getComponent('per').getComponent('perempty').show();
        } else if(audience) {
Severity: Major
Found in app/assets/javascripts/documents/AddEditFolderWindow.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

            if ( s.dataType == "script" && type == "GET" && parts
                && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
    
                var head = document.getElementsByTagName("head")[0];
                var script = document.createElement("script");
    Severity: Major
    Found in app/assets/javascripts/jquery.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

      if (!Ext.dd.DragDropMgr) {
      
      /**
       * @class Ext.dd.DragDropMgr
       * DragDropMgr is a singleton that tracks the element interaction for
      Severity: Major
      Found in app/assets/javascripts/ext/src/dd/DDCore.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                    if(!this.isHiddenRoot() && (this.getOwnerTree().animate && anim !== false) || anim){
                        this.ui.animExpand(function(){
                            this.fireEvent('expand', this);
                            this.runCallback(callback, scope || this, [this]);
                            if(deep === true){
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/tree/TreeNode.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if(ename == 'collapse' || ename == 'expand' || ename == 'beforecollapse' || ename == 'beforeexpand' || ename == 'move' || ename == 'beforemove'){
                      ename = ename+'node';
                  }
          Severity: Major
          Found in app/assets/javascripts/ext/src/widgets/tree/TreePanel.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                    if(this.anchor){
                        this.targetCounter++;
                        var offsets = this.getOffsets(),
                            xy = (this.anchorToTarget && !this.trackMouse) ? this.el.getAlignToXY(this.anchorTarget, this.getAnchorAlign()) : this.targetXY,
                            dw = Ext.lib.Dom.getViewWidth() - 5,
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/tips/ToolTip.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if(tag == 'td' && (where == afterbegin || where == beforeend) ||
                         !tableElRe.test(tag) && (where == beforebegin || where == afterend)) {
                          return;
                      }
              Severity: Major
              Found in app/assets/javascripts/ext/src/ext-core/src/core/DomHelper.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                        } else if ((tag == 'tbody' && (where == beforeend || where == afterbegin)) ||
                                   (tag == 'tr' && (where == beforebegin || where == afterend))) {
                            node = ieTable(3, tbs, html, tbe);
                        } else {
                            node = ieTable(2, ts, html, te);
                Severity: Major
                Found in app/assets/javascripts/ext/src/ext-core/src/core/DomHelper.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                                      if ( (mo && !absparent && elemPos != 'fixed') || 
                                           (ie && elemPos == 'static' && !relparent) ) {
                                          x += num(parent, 'borderLeftWidth');
                                          y += num(parent, 'borderTopWidth');
                                      }
                  Severity: Major
                  Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                                if ( getComputedStyle && !color( elem ) )
                                    ret = getComputedStyle.getPropertyValue( name );
                    
                                // If the element isn't reporting its values properly in Safari
                                // then some display: none elements are involved
                    Severity: Major
                    Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if(!this.grid || this.isLocked() || (index < 0 || index >= this.grid.store.getCount()) || (keepExisting && this.isSelected(index))){
                                  return;
                              }
                      Severity: Major
                      Found in app/assets/javascripts/ext_extensions/overrides.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                        if ( ! window[ STR_DOMINOES ] )
                                
                        (function(
                            STR_ASYNC,
                            STR_CACHE,
                        Severity: Major
                        Found in app/assets/javascripts/lib/dominoes-1.0-rc2.js - About 40 mins to fix

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

                                  this.mainHd.on({
                                      scope    : this,
                                      mouseover: this.handleHdOver,
                                      mouseout : this.handleHdOut,
                                      mousemove: this.handleHdMove
                          Severity: Major
                          Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 3 other locations - About 40 mins to fix
                          app/assets/javascripts/ext/src/widgets/LoadMask.js on lines 28..33
                          app/assets/javascripts/ext/src/widgets/form/Combo.js on lines 721..726
                          app/assets/javascripts/ext/src/widgets/form/CompositeField.js on lines 119..124

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  this.leftRepeater = new Ext.util.ClickRepeater(sl, {
                                      interval : this.scrollRepeatInterval,
                                      handler: this.onscrollTop,
                                      scope: this
                                  });
                          app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 924..928
                          app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 937..941
                          app/assets/javascripts/ext/src/widgets/layout/box/ScrollerOverflow.js on lines 161..165
                          app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 810..814

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  this.rightRepeater = new Ext.util.ClickRepeater(sr, {
                                      interval : this.scrollRepeatInterval,
                                      handler: this.onScrollRight,
                                      scope: this
                                  });
                          Severity: Major
                          Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 4 other locations - About 40 mins to fix
                          app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 924..928
                          app/assets/javascripts/ext/src/widgets/layout/box/ScrollerOverflow.js on lines 161..165
                          app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 797..801
                          app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 810..814

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  this.rightRepeater = new Ext.util.ClickRepeater(sr, {
                                      interval : this.scrollRepeatInterval,
                                      handler: this.onscrollBottom,
                                      scope: this
                                  });
                          app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 924..928
                          app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 937..941
                          app/assets/javascripts/ext/src/widgets/layout/box/ScrollerOverflow.js on lines 161..165
                          app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 797..801

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                                      this.beforeRepeater = new Ext.util.ClickRepeater(before, {
                                          interval: this.scrollRepeatInterval,
                                          handler : this.scrollLeft,
                                          scope   : this
                                      });
                          app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 924..928
                          app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 937..941
                          app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 797..801
                          app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 810..814

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

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

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

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

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

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language