mambax7/alumni-26x

View on GitHub
media/jquery/tablesorter-master/js/widgets/widget-scroller.js

Summary

Maintainability
F
5 days
Test Coverage

File widget-scroller.js has 729 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! Widget: scroller - updated 12/13/2017 (v2.29.1) *//*
    Copyright (C) 2011 T. Connell & Associates, Inc.

    Dual-licensed under the MIT and GPL licenses

Severity: Major
Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js - About 1 day to fix

    Function setup has 130 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            setup : function( c, wo ) {
                var tbHt, $hdr, $t, $hCells, $fCells, $tableWrap, events, tmp, detectedWidth,
                    $win = $( window ),
                    tsScroller = ts.scroller,
                    namespace = c.namespace + 'tsscroller',
    Severity: Major
    Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js - About 5 hrs to fix

      Function updateFixed has 120 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              updateFixed : function( c, wo ) {
                  var temp, adj,
                      $wrapper = wo.scroller_$container,
                      $hdr = wo.scroller_$header,
                      $foot = wo.scroller_$footer,
      Severity: Major
      Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js - About 4 hrs to fix

        Function resize has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                resize : function( c, wo ) {
                    if ( wo.scroller_isBusy ) { return; }
                    var index, borderWidth, setWidth, $headers, $this,
                        tsScroller = ts.scroller,
                        $container = wo.scroller_$container,
        Severity: Major
        Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js - About 3 hrs to fix

          Function setupFixed has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  setupFixed : function( c, wo ) {
                      var index, index2, $el, len, temp, $fixedColumn, $fixedTbody,
                          $table = c.$table,
                          $wrapper = wo.scroller_$container,
                          fixedColumns = wo.scroller_fixedColumns;
          Severity: Major
          Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js - About 2 hrs to fix

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

                    bindFixedColumnEvents : function( c, wo ) {
                        // update thead & tbody in fixed column
                        var tsScroller = ts.scroller,
                            namespace = c.namespace + 'tsscrollerFixed',
                            events = 'scroll' + namespace,
            Severity: Major
            Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js - About 2 hrs to fix

              Function updateRowHeight has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      updateRowHeight : function( c, wo ) {
                          var $rows, $fixed,
                              $fixedColumns = wo.scroller_$fixedColumns;
              
                          wo.scroller_$container
              Severity: Minor
              Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js - About 1 hr to fix

                Function adjustWidth has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        adjustWidth : function( c, wo, totalWidth, adj, dir ) {
                Severity: Minor
                Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js - About 35 mins to fix

                  HACK found
                  Open

                              /*** scrollbar HACK! Since we can't hide the scrollbar with css ***/

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

                      ts.window_resize = function() {
                          if ( ts.timer_resize ) {
                              clearTimeout( ts.timer_resize );
                          }
                          ts.timer_resize = setTimeout( function() {
                  media/jquery/tablesorter-master/js/widgets/widget-columnSelector.js on lines 482..489

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

                  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

                              $wrapper
                                  .children( '.' + tscss.scrollerHeader + ', .' + tscss.scrollerFooter )
                                  // Safari needs a scrollbar width of extra adjusment to align the fixed & scrolling columns
                                  .css( dir ? 'right' : 'left', totalWidth + ( dir && ts.scroller.isSafari ? adj : 0 ) );
                  media/jquery/tablesorter-master/js/widgets/widget-scroller.js on lines 681..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 72.

                  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

                              $wrapper
                                  .children( '.' + tscss.scrollerHeader + ', .' + tscss.scrollerFooter )
                                  // Safari needs a scrollbar width of extra adjusment to align the fixed & scrolling columns
                                  .css( dir ? 'right' : 'left', totalWidth + ( dir && ts.scroller.isSafari ? adj : 0 ) );
                  media/jquery/tablesorter-master/js/widgets/widget-scroller.js on lines 819..822

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

                  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

                              $fixed = $fixedColumns
                                  .children( '.' + tscss.scrollerHeader )
                                  .children( 'table' )
                                  .children( 'thead' )
                                  .children( 'tr' );
                  Severity: Minor
                  Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js and 2 other locations - About 35 mins to fix
                  media/jquery/tablesorter-master/js/widgets/widget-scroller.js on lines 893..897
                  media/jquery/tablesorter-master/js/widgets/widget-scroller.js on lines 907..911

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

                              $fixed = $fixedColumns
                                  .children( '.' + tscss.scrollerFooter )
                                  .children( 'table' )
                                  .children( 'tfoot' )
                                  .children( 'tr' );
                  Severity: Minor
                  Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js and 2 other locations - About 35 mins to fix
                  media/jquery/tablesorter-master/js/widgets/widget-scroller.js on lines 883..887
                  media/jquery/tablesorter-master/js/widgets/widget-scroller.js on lines 907..911

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

                              $fixed = $fixedColumns
                                  .children( '.' + tscss.scrollerTable )
                                  .children( 'table' )
                                  .children( 'tbody' )
                                  .children( 'tr' );
                  Severity: Minor
                  Found in media/jquery/tablesorter-master/js/widgets/widget-scroller.js and 2 other locations - About 35 mins to fix
                  media/jquery/tablesorter-master/js/widgets/widget-scroller.js on lines 883..887
                  media/jquery/tablesorter-master/js/widgets/widget-scroller.js on lines 893..897

                  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

                  There are no issues that match your filters.

                  Category
                  Status