adobe/brackets

View on GitHub
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js

Summary

Maintainability
F
1 wk
Test Coverage

File jquery.ui.tabs.js has 1060 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery UI Tabs @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.

    Function _create has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _create: function() {
            var panel,
                that = this,
                options = this.options,
                active = options.active;

      Function _destroy has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _destroy: function() {
              if ( this.xhr ) {
                  this.xhr.abort();
              }
      
      

        Function _processTabs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _processTabs: function() {
                var that = this;
        
                this.tablist = this._getList()
                    .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )

          Function _toggle has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _toggle: function( event, eventData ) {
                  var that = this,
                      toShow = eventData.newPanel,
                      toHide = eventData.oldPanel;
          
          

            Function _tabKeydown has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _tabKeydown: function( event ) {
                    var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
                        selectedIndex = this.tabs.index( focusedTab ),
                        goingForward = true;
            
            

              Function load has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  load: function( index, event ) {
                      index = this._getIndex( index );
                      var that = this,
                          tab = this.tabs.eq( index ),
                          anchor = tab.find( ".ui-tabs-anchor" ),

                Function add has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        add: function( url, label, index ) {
                            if ( index === undefined ) {
                                index = this.anchors.length;
                            }
                
                

                  Function _toggle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _toggle: function( event, eventData ) {
                              var that = this,
                                  toShow = eventData.newPanel,
                                  toHide = eventData.oldPanel,
                                  fx = this._getFx();

                    Function _eventHandler has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _eventHandler: function( event ) {
                            var options = this.options,
                                active = this.active,
                                anchor = $( event.currentTarget ),
                                tab = anchor.closest( "li" ),

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

                          _setupHeightStyle: function( heightStyle ) {
                              var maxHeight, overflow,
                                  parent = this.element.parent();
                      
                              if ( heightStyle === "fill" ) {

                        Function _refresh has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _refresh: function() {
                                this._setupDisabled( this.options.disabled );
                                this._setupEvents( this.options.event );
                                this._setupHeightStyle( this.options.heightStyle );
                        
                        

                          Consider simplifying this complex logical expression.
                          Open

                          if ( $.uiBackCompat !== false ) {
                          
                              // helper method for a lot of the back compat extensions
                              $.ui.tabs.prototype._ui = function( tab, panel ) {
                                  return {

                            Consider simplifying this complex logical expression.
                            Open

                                    if ( tab.hasClass( "ui-state-disabled" ) ||
                                            // tab is already loading
                                            tab.hasClass( "ui-tabs-loading" ) ||
                                            // can't switch durning an animation
                                            this.running ||

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

                                      enable: function( index ) {
                                          var options = this.options,
                                              trigger;
                              
                                          if ( index && options.disabled === true ||
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js on lines 986..1000

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

                              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

                                      disable: function( index ) {
                                          var options = this.options,
                                              trigger;
                              
                                          if ( index && options.disabled === false ||
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js on lines 970..984

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

                              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

                                          this.element.siblings( ":visible" ).each(function() {
                                              var elem = $( this ),
                                                  position = elem.css( "position" );
                              
                                              if ( position === "absolute" || position === "fixed" ) {
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.accordion.js on lines 312..320

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

                              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 ( type === "beforeActivate" && data.newTab.length ) {
                                              ret = this._super( "select", event, {
                                                  tab: data.newTab.find( ".ui-tabs-anchor" )[ 0],
                                                  panel: data.newPanel[ 0 ],
                                                  index: data.newTab.closest( "li" ).index()
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js on lines 1192..1198

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

                              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 if ( type === "activate" && data.newTab.length ) {
                                              ret = this._super( "show", event, {
                                                  tab: data.newTab.find( ".ui-tabs-anchor" )[ 0 ],
                                                  panel: data.newPanel[ 0 ],
                                                  index: data.newTab.closest( "li" ).index()
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js on lines 1186..1198

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

                              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 ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
                                          this._activate( this._focusNextTab( this.options.active - 1, false ) );
                                          return true;
                                      }
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js on lines 226..229

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

                              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 ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
                                          this._activate( this._focusNextTab( this.options.active + 1, true ) );
                                          return true;
                                      }
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js on lines 222..225

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

                              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 ( toShow.length && toHide.length ) {
                                          eventData.oldTab.attr( "tabIndex", -1 );
                                      } else if ( toShow.length ) {
                                          this.tabs.filter(function() {
                                              return $( this ).attr( "tabIndex" ) === 0;
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.accordion.js on lines 464..471

                              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

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

                                          this.panels.each(function() {
                                              $( this ).height( Math.max( 0, maxHeight -
                                                  $( this ).innerHeight() + $( this ).height() ) );
                                          })
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.accordion.js on lines 329..333

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

                              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.anchors
                                          .removeClass( "ui-tabs-anchor" )
                                          .removeAttr( "role" )
                                          .removeAttr( "tabIndex" )
                                          .unbind( ".tabs" )
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.accordion.js on lines 181..191
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.menu.js on lines 151..156

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

                              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

                                          if ( !$.support.minHeight ) {
                                              overflow = parent.css( "overflow" );
                                              parent.css( "overflow", "hidden");
                                          }
                              src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.accordion.js on lines 307..310

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

                              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