LearnPAd/learnpad

View on GitHub
lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tips-debug.js

Summary

Maintainability
F
1 wk
Test Coverage

File pkg-tips-debug.js has 783 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Ext JS Library 3.4.0
 * Copyright(c) 2006-2011 Sencha Inc.
 * licensing@sencha.com
 * http://www.sencha.com/license

    Function getTargetXY has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
    Open

        getTargetXY : function(){
            if(this.delegate){
                this.anchorTarget = this.triggerElement;
            }
            if(this.anchor){

    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

    ToolTip has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ext.ToolTip = Ext.extend(Ext.Tip, {
        /**
         * When a Tooltip is configured with the <code>{@link #delegate}</code>
         * option to cause selected child elements of the <code>{@link #target}</code>
         * Element to each trigger a seperate show event, this property is set to

      Function QuickTips has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Ext.QuickTips = function(){
          var tip,
              disabled = false;
              
          return {

        Function getTargetXY has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            getTargetXY : function(){
                if(this.delegate){
                    this.anchorTarget = this.triggerElement;
                }
                if(this.anchor){

          Function QuickTips has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          Ext.QuickTips = function(){
              var tip,
                  disabled = false;
                  
              return {

          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 showAt has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              showAt : function(xy){
                  var t = this.activeTarget;
                  if(t){
                      if(!this.rendered){
                          this.render(Ext.getBody());

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

              onTargetOver : function(e){
                  if(this.disabled){
                      return;
                  }
                  this.targetXY = e.getXY();

            Function onTargetOver has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                onTargetOver : function(e){
                    if(this.disabled){
                        return;
                    }
                    this.targetXY = e.getXY();

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

                getOffsets : function(){
                    var offsets, 
                        ap = this.getAnchorPosition().charAt(0);
                    if(this.anchorToTarget && !this.trackMouse){
                        switch(ap){

              Function register has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  register : function(config){
                      var cs = Ext.isArray(config) ? config : arguments;
                      for(var i = 0, len = cs.length; i < len; i++){
                          var c = cs[i];
                          var target = c.target;

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

                  showAt : function(xy){
                      var t = this.activeTarget;
                      if(t){
                          if(!this.rendered){
                              this.render(Ext.getBody());

                Function onMouseMove has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    onMouseMove : function(e){
                        var t = this.delegate ? e.getTarget(this.delegate) : this.triggerElement = true;
                        if (t) {
                            this.targetXY = e.getXY();
                            if (t === this.triggerElement) {

                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

                Avoid deeply nested control flow statements.
                Open

                                        if(this.mouseOffset){this.mouseOffset[0] *= -1;}

                  Avoid deeply nested control flow statements.
                  Open

                                          if(this.mouseOffset){this.mouseOffset[1] *= -1;}

                    Avoid deeply nested control flow statements.
                    Open

                                            if(this.mouseOffset){this.mouseOffset[1] *= -1;}

                      Avoid deeply nested control flow statements.
                      Open

                                              if(this.mouseOffset){this.mouseOffset[0] *= -1;}

                        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,

                          Function getOffsets has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getOffsets : function(){
                                  var offsets, 
                                      ap = this.getAnchorPosition().charAt(0);
                                  if(this.anchorToTarget && !this.trackMouse){
                                      switch(ap){

                          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

                          Avoid too many return statements within this function.
                          Open

                                      return [this.targetXY[0]+mouseOffset[0], this.targetXY[1]+mouseOffset[1]];

                            Avoid too many return statements within this function.
                            Open

                                        return axy;

                              Function delayShow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  delayShow : function(){
                                      if(this.hidden && !this.showTimer){
                                          if(this.lastActive.getElapsed() < this.quickShowInterval){
                                              this.show();
                                          }else{

                              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

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

                                              if(axy[1]+sz.height > dh){
                                                  if(this.anchorToTarget){
                                                      this.defaultAlign = 'b-t';
                                                      if(this.mouseOffset){this.mouseOffset[1] *= -1;}
                                                  }
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tips-debug.js on lines 368..375

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

                              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(axy[0]+sz.width > dw){
                                                  if(this.anchorToTarget){
                                                      this.defaultAlign = 'r-l';
                                                      if(this.mouseOffset){this.mouseOffset[0] *= -1;}
                                                  }
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tips-debug.js on lines 384..391

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

                              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(axy[1] < scrollY){
                                                  if(this.anchorToTarget){
                                                      this.defaultAlign = 't-b';
                                                      if(this.mouseOffset){this.mouseOffset[1] *= -1;}
                                                  }
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tips-debug.js on lines 360..367

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

                              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(axy[0] < scrollX){
                                                  if(this.anchorToTarget){
                                                      this.defaultAlign = 'l-r';
                                                      if(this.mouseOffset){this.mouseOffset[0] *= -1;}
                                                  }
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tips-debug.js on lines 376..383

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

                              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(){
                                      Ext.ToolTip.superclass.onHide.call(this);
                                      Ext.getDoc().un('mousedown', this.onDocMouseDown, this);
                                  },
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tips-debug.js on lines 633..636

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

                              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(){
                                      Ext.ToolTip.superclass.onShow.call(this);
                                      Ext.getDoc().on('mousedown', this.onDocMouseDown, this);
                                  },
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tips-debug.js on lines 639..642

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

                              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

                                      slider.on({
                                          scope    : this,
                                          dragstart: this.onSlide,
                                          drag     : this.onSlide,
                                          dragend  : this.hide,
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tree-debug.js on lines 4217..4223
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/ux/gridfilters/GridFilters.js on lines 210..216

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

                              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

                                  Ext.Tip.DD.superclass.constructor.call(this, tip.el.id, 'WindowDD-'+tip.id);
                              lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/window-debug.js on lines 1008..1008

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

                              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