LearnPAd/learnpad

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

Summary

Maintainability
F
4 days
Test Coverage

File pkg-tabs-debug.js has 575 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

    TabPanel has 44 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ext.TabPanel = Ext.extend(Ext.Panel,  {
        /**
         * @cfg {Boolean} layoutOnTabChange
         * Set to true to force a layout of the active tab when the tab is changed. Defaults to false.
         * See {@link Ext.layout.CardLayout}.<code>{@link Ext.layout.CardLayout#layoutOnCardChange layoutOnCardChange}</code>.

      Function autoScrollTabs has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          autoScrollTabs : function(){
              this.pos = this.tabPosition=='bottom' ? this.footer : this.header;
              var count = this.items.length,
                  ow = this.pos.dom.offsetWidth,
                  tw = this.pos.dom.clientWidth,

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

          autoScrollTabs : function(){
              this.pos = this.tabPosition=='bottom' ? this.footer : this.header;
              var count = this.items.length,
                  ow = this.pos.dom.offsetWidth,
                  tw = this.pos.dom.clientWidth,

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

            setActiveTab : function(item){
                item = this.getComponent(item);
                if(this.fireEvent('beforetabchange', this, item, this.activeTab) === 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 initTab has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            initTab : function(item, index){
                var before = this.strip.dom.childNodes[index],
                    p = this.getTemplateArgs(item),
                    el = before ?
                         this.itemTpl.insertBefore(before, p) :

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

              setActiveTab : function(item){
                  item = this.getComponent(item);
                  if(this.fireEvent('beforetabchange', this, item, this.activeTab) === false){
                      return;
                  }

            Function onRemove has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                onRemove : function(c){
                    var te = Ext.get(c.tabEl);
                    // check if the tabEl exists, it won't if the tab isn't rendered
                    if(te){
                        te.select('a').removeAllListeners();

              Function onRender has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  onRender : function(ct, position){
                      Ext.TabPanel.superclass.onRender.call(this, ct, position);
              
                      if(this.plain){
                          var pos = this.tabPosition == 'top' ? 'header' : 'footer';

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

                    onRemove : function(c){
                        var te = Ext.get(c.tabEl);
                        // check if the tabEl exists, it won't if the tab isn't rendered
                        if(te){
                            te.select('a').removeAllListeners();

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

                Ext.TabPanel.AccessStack = function(){
                    var items = [];
                    return {
                        add : function(item){
                            items.push(item);

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

                    onStripMouseDown : function(e){
                        if(e.button !== 0){
                            return;
                        }
                        e.preventDefault();

                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

                        item.on({
                            scope: this,
                            disable: this.onItemDisabled,
                            enable: this.onItemEnabled,
                            titlechange: this.onItemTitleChanged,
                lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-charts-debug.js on lines 1182..1189

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

                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(Ext.isAir || Ext.isWebKit){
                                    wd.style.marginLeft = '';
                                    wd.style.marginRight = '';
                                }
                lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tabs-debug.js on lines 888..891

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

                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(Ext.isAir || Ext.isWebKit){
                                    wd.style.marginLeft = '18px';
                                    wd.style.marginRight = '18px';
                                }
                lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tabs-debug.js on lines 879..882

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

                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

                        this.rightRepeater = new Ext.util.ClickRepeater(sr, {
                            interval : this.scrollRepeatInterval,
                            handler: this.onScrollRight,
                            scope: this
                        });
                lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tabs-debug.js on lines 924..928

                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

                        this.leftRepeater = new Ext.util.ClickRepeater(sl, {
                            interval : this.scrollRepeatInterval,
                            handler: this.onScrollLeft,
                            scope: this
                        });
                lp-dashboard-kpi/lp-dash-adoxx-cockpit/src/main/webapp/ext-3.4.0/pkgs/pkg-tabs-debug.js on lines 937..941

                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

                There are no issues that match your filters.

                Category
                Status