talho/openphin

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

Summary

Maintainability
D
1 day
Test Coverage

File Container.js has 344 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/Container.js - About 4 hrs to fix

    Container has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ext.Container = Ext.extend(Ext.BoxComponent, {
        /**
         * @cfg {Boolean} monitorResize
         * True to automatically monitor window resize events to handle anything that is sensitive to the current size
         * of the viewport.  This value is typically managed by the chosen <code>{@link #layout}</code> and should not need
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/Container.js - About 4 hrs to fix

      Function doLayout has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          doLayout : function(shallow, force){
              var rendered = this.rendered,
                  forceLayout = force || this.forceLayout;
      
              if(this.collapsed || !this.canLayout()){
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/Container.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 cascade has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          cascade : function(fn, scope, args){
              if(fn.apply(scope || this, args || [this]) !== false){
                  if(this.items){
                      var cs = this.items.items;
                      for(var i = 0, len = cs.length; i < len; i++){
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/Container.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 doLayout has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          doLayout : function(shallow, force){
              var rendered = this.rendered,
                  forceLayout = force || this.forceLayout;
      
              if(this.collapsed || !this.canLayout()){
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/Container.js - About 1 hr to fix

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

            applyDefaults : function(c){
                var d = this.defaults;
                if(d){
                    if(Ext.isFunction(d)){
                        d = d.call(this, c);
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/Container.js - About 35 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 insert has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            insert : function(index, comp) {
                var args   = arguments,
                    length = args.length,
                    result = [],
                    i, c;
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/Container.js - About 35 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 afterRender has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            afterRender: function(){
                // Render this Container, this should be done before setLayout is called which
                // will hook onResize
                Ext.Container.superclass.afterRender.call(this);
                if(!this.layout){
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/Container.js - About 35 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 add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            add : function(comp){
                this.initItems();
                var args = arguments.length > 1;
                if(args || Ext.isArray(comp)){
                    var result = [];
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/Container.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

        There are no issues that match your filters.

        Category
        Status