LearnPAd/learnpad

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

Summary

Maintainability
F
1 wk
Test Coverage

File window-debug.js has 1166 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 MessageBox has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

    Ext.MessageBox = function(){
        var dlg, opt, mask, waitTimer,
            bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl,
            buttons, activeTextEl, bwidth, bufferIcon = '', iconCls = '',
            buttonNames = ['ok', 'yes', 'no', 'cancel'];

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

    Ext.MessageBox = function(){
        var dlg, opt, mask, waitTimer,
            bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl,
            buttons, activeTextEl, bwidth, bufferIcon = '', iconCls = '',
            buttonNames = ['ok', 'yes', 'no', 'cancel'];

      Function WindowGroup has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

      Ext.WindowGroup = function(){
          var list = {};
          var accessList = [];
          var front = null;
      
      

      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

      Window has 42 functions (exceeds 20 allowed). Consider refactoring.
      Open

      Ext.Window = Ext.extend(Ext.Panel, {
          /**
           * @cfg {Number} x
           * The X position of the left edge of the window on initial showing. Defaults to centering the Window within
           * the width of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to).

        Function WindowGroup has 105 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Ext.WindowGroup = function(){
            var list = {};
            var accessList = [];
            var front = null;
        
        

          Function show has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  show : function(options){
                      if(this.isVisible()){
                          this.hide();
                      }
                      opt = options;

            Function getDialog has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    getDialog : function(titleText){
                       if(!dlg){
                            var btns = [];
                            
                            buttons = {};

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

                  focus : function(){
                      var f = this.focusEl,
                          db = this.defaultButton,
                          t = typeof db,
                          el,

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

                  initEvents : function(){
                      Ext.Window.superclass.initEvents.call(this);
                      if(this.animateTarget){
                          this.setAnimateTarget(this.animateTarget);
                      }

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

                    afterShow : function(isAnim){
                        if (this.isDestroyed){
                            return false;
                        }
                        this.proxy.hide();

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

                      afterShow : function(isAnim){
                          if (this.isDestroyed){
                              return false;
                          }
                          this.proxy.hide();

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

                      restore : function(){
                          if(this.maximized){
                              var t = this.tools;
                              this.el.removeClass('x-window-maximized');
                              if(t.restore){

                    Function restore has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        restore : function(){
                            if(this.maximized){
                                var t = this.tools;
                                this.el.removeClass('x-window-maximized');
                                if(t.restore){

                    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 prompt has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            prompt : function(title, msg, fn, scope, multiline, value){

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

                          show : function(animateTarget, cb, scope){
                              if(!this.rendered){
                                  this.render(Ext.getBody());
                              }
                              if(this.hidden === false){

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

                          maximize : function(){
                              if(!this.maximized){
                                  this.expand(false);
                                  this.restoreSize = this.getSize();
                                  this.restorePos = this.getPosition(true);

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

                          beforeShow : function(){
                              delete this.el.lastXY;
                              delete this.el.lastLT;
                              if(this.x === undefined || this.y === undefined){
                                  var xy = this.el.getAlignToXY(this.container, 'c-c');

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

                          unghost : function(show, matchPosition){
                              if(!this.activeGhost) {
                                  return;
                              }
                              if(show !== false){

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

                          hide : function(animateTarget, cb, scope){
                              if(this.hidden || this.fireEvent('beforehide', this) === false){
                                  return this;
                              }
                              if(cb){

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

                          doConstrain : function(){
                              if(this.constrain || this.constrainHeader){
                                  var offsets;
                                  if(this.constrain){
                                      offsets = {

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

                          initEvents : function(){
                              Ext.Window.superclass.initEvents.call(this);
                              if(this.animateTarget){
                                  this.setAnimateTarget(this.animateTarget);
                              }

                      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(this.monitorResize || this.modal || this.constrain || this.constrainHeader){
                                  Ext.EventManager.onWindowResize(this.onWindowResize, this);
                              }
                      lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/window-debug.js on lines 638..640

                      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

                              if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){
                                  Ext.EventManager.removeResizeListener(this.onWindowResize, this);
                              }
                      lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/window-debug.js on lines 569..571

                      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

                                  this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));
                      lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/resizable-debug.js on lines 331..331
                      lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/window-debug.js on lines 684..684

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

                                  this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));
                      lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/resizable-debug.js on lines 331..331
                      lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/window-debug.js on lines 514..514

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

                                  if (this.maximizable){
                                      this.tools.maximize.hide();
                                      this.tools.restore.show();
                                  }
                      lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/ux/ItemSelector.js on lines 140..143

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

                      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.Window.DD.superclass.constructor.call(this, win.el.id, 'WindowDD-'+win.id);
                      lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tips-debug.js on lines 146..146

                      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