talho/openphin

View on GitHub
app/assets/javascripts/ext/src/debug.js

Summary

Maintainability
F
5 days
Test Coverage

File debug.js has 721 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: Major
Found in app/assets/javascripts/ext/src/debug.js - About 1 day to fix

    Function HtmlNode has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Ext.debug.HtmlNode = function(){
        var html = Ext.util.Format.htmlEncode;
        var ellipsis = Ext.util.Format.ellipsis;
        var nonSpace = /^\s*$/;
    
    
    Severity: Major
    Found in app/assets/javascripts/ext/src/debug.js - About 3 hrs to fix

      Function HtmlNode has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      Ext.debug.HtmlNode = function(){
          var html = Ext.util.Format.htmlEncode;
          var ellipsis = Ext.util.Format.ellipsis;
          var nonSpace = /^\s*$/;
      
      
      Severity: Minor
      Found in app/assets/javascripts/ext/src/debug.js - About 3 hrs to fix

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

          initComponent : function(){
      
      
              Ext.debug.DomTree.superclass.initComponent.call(this);
      
      
      Severity: Minor
      Found in app/assets/javascripts/ext/src/debug.js - About 3 hrs to fix

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

      function createConsole(){
      
          var scriptPanel = new Ext.debug.ScriptsPanel();
          var logView = new Ext.debug.LogPanel();
          var tree = new Ext.debug.DomTree();
      Severity: Major
      Found in app/assets/javascripts/ext/src/debug.js - About 3 hrs to fix

        Function initComponent has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            initComponent : function(){
        
        
                Ext.debug.DomTree.superclass.initComponent.call(this);
        
        
        Severity: Major
        Found in app/assets/javascripts/ext/src/debug.js - About 2 hrs to fix

          Function renderElements has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              renderElements : function(n, a, targetNode, bulkRender){
                  this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
          
                  var t = n.getOwnerTree();
                  var cols = t.columns;
          Severity: Minor
          Found in app/assets/javascripts/ext/src/debug.js - About 1 hr to fix

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

              renderElements : function(n, a, targetNode, bulkRender){
                  this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
          
                  var t = n.getOwnerTree();
                  var cols = t.columns;
          Severity: Minor
          Found in app/assets/javascripts/ext/src/debug.js - About 1 hr to fix

            Function initComponent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                initComponent : function(){
                    this.showFunc = false;
                    this.toggleFunc = function() {
                        this.showFunc = !this.showFunc;
                        this.refreshNodes(this.currentObject);
            Severity: Minor
            Found in app/assets/javascripts/ext/src/debug.js - About 1 hr to fix

              Function parseChildItems has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  parseChildItems: function(n) {
                      var cn = n.attributes.component.items;
                      if (cn) {
                          for (var i = 0;i < cn.length; i++) {
                              var c = cn.get(i);
              Severity: Minor
              Found in app/assets/javascripts/ext/src/debug.js - About 1 hr to fix

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

                  parseRootNode: function() {
                      var n = this.root;
                      var cn = n.attributes.component.items;
                      for (var i = 0,c;c = cn[i];i++) {
                          if (c.id != this.id && c.id != this.bottomToolbar.id) {
              Severity: Minor
              Found in app/assets/javascripts/ext/src/debug.js - About 1 hr to fix

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

                  evalScript : function(){
                      var s = this.scriptField.getValue();
                      if(this.trapBox.getValue()){
                          try{
                              var rt = eval(s);
              Severity: Minor
              Found in app/assets/javascripts/ext/src/debug.js - About 55 mins to fix

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

                  parseNodes: function() {
                      for (var o in this.currentObject) {
                          if (!this.showFunc) {
                              if (Ext.isFunction(this.currentObject[o])) {
                                  continue;
              Severity: Minor
              Found in app/assets/javascripts/ext/src/debug.js - About 25 mins to fix

              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

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

                  onClick: function(node, e) {
                      var oi = Ext.getCmp('x-debug-objinspector');
                      oi.refreshNodes(node.attributes.component);
                      oi.ownerCt.show();
                  },
              Severity: Major
              Found in app/assets/javascripts/ext/src/debug.js and 1 other location - About 1 hr to fix
              app/assets/javascripts/ext/src/debug.js on lines 775..779

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

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

                  onClick: function(node, e) {
                      var oi = Ext.getCmp('x-debug-objinspector');
                      oi.refreshNodes(node.attributes.component);
                      oi.ownerCt.show();
                  },
              Severity: Major
              Found in app/assets/javascripts/ext/src/debug.js and 1 other location - About 1 hr to fix
              app/assets/javascripts/ext/src/debug.js on lines 489..493

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

              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 (val) {
                                      Ext.ComponentMgr.all.on('add', this.onAdd, this);
                                      Ext.ComponentMgr.all.on('remove', this.onRemove, this);
                                  } else {
              Severity: Minor
              Found in app/assets/javascripts/ext/src/debug.js and 1 other location - About 55 mins to fix
              app/assets/javascripts/ext/src/debug.js on lines 527..530

              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

                                  } else {
                                      Ext.ComponentMgr.all.un('add', this.onAdd, this);
                                      Ext.ComponentMgr.all.un('remove', this.onRemove, this);
                                  }
              Severity: Minor
              Found in app/assets/javascripts/ext/src/debug.js and 1 other location - About 55 mins to fix
              app/assets/javascripts/ext/src/debug.js on lines 524..527

              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

              There are no issues that match your filters.

              Category
              Status