talho/openphin

View on GitHub
app/assets/javascripts/ext/src/widgets/Layer.js

Summary

Maintainability
D
2 days
Test Coverage

File Layer.js has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Ext JS Library 3.3.0
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 4 hrs to fix

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

        constrainXY : function(){
            if(this.constrain){
                var vw = Ext.lib.Dom.getViewWidth(),
                    vh = Ext.lib.Dom.getViewHeight();
                var s = Ext.getDoc().getScroll();
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 1 hr to fix

      Function Layer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Ext.Layer = function(config, existingEl){
          config = config || {};
          var dh = Ext.DomHelper,
              cp = config.parentEl, pel = cp ? Ext.getDom(cp) : document.body;
              
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 1 hr to fix

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

            setVisible : function(v, a, d, c, e){
                if(v){
                    this.showAction();
                }
                if(a && v){
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 1 hr to fix

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

              sync : function(doShow){
                  var shadow = this.shadow;
                  if(!this.updating && this.isVisible() && (shadow || this.useShim)){
                      var shim = this.getShim(),
                          w = this.getWidth(),
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 1 hr to fix

            Function setBounds has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                setBounds : function(x, y, w, h, a, d, c, e){
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 1 hr to fix

              Function setSize has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  setSize : function(w, h, a, d, c, e){
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 45 mins to fix

                Function setWidth has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    setWidth : function(w, a, d, c, e){
                Severity: Minor
                Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 35 mins to fix

                  Function setX has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      setX : function(x, a, d, c, e){
                  Severity: Minor
                  Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 35 mins to fix

                    Function setVisible has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        setVisible : function(v, a, d, c, e){
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 35 mins to fix

                      Function setY has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          setY : function(y, a, d, c, e){
                      Severity: Minor
                      Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 35 mins to fix

                        Function setHeight has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            setHeight : function(h, a, d, c, e){
                        Severity: Minor
                        Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 35 mins to fix

                          Function setXY has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              setXY : function(xy, a, d, c, e){
                          Severity: Minor
                          Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 35 mins to fix

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

                                setWidth : function(w, a, d, c, e){
                                    this.beforeAction();
                                    var cb = this.createCB(c);
                                    supr.setWidth.call(this, w, a, d, cb, e);
                                    if(!a){
                            Severity: Major
                            Found in app/assets/javascripts/ext/src/widgets/Layer.js and 1 other location - About 2 hrs to fix
                            app/assets/javascripts/ext/src/widgets/Layer.js on lines 425..433

                            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

                                setHeight : function(h, a, d, c, e){
                                    this.beforeAction();
                                    var cb = this.createCB(c);
                                    supr.setHeight.call(this, h, a, d, cb, e);
                                    if(!a){
                            Severity: Major
                            Found in app/assets/javascripts/ext/src/widgets/Layer.js and 1 other location - About 2 hrs to fix
                            app/assets/javascripts/ext/src/widgets/Layer.js on lines 414..422

                            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

                            There are no issues that match your filters.

                            Category
                            Status