ocadotechnology/rapid-router

View on GitHub
game/static/game/js/widget-scroller.js

Summary

Maintainability
F
4 days
Test Coverage

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

/*! Widget: scroller - updated 5/17/2015 (v2.22.0) *//*
 Copyright (C) 2011 T. Connell & Associates, Inc.

 Dual-licensed under the MIT and GPL licenses

Severity: Major
Found in game/static/game/js/widget-scroller.js - About 1 day to fix

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

            updateFixed : function( c, wo ) {
                var $wrapper = wo.scroller_$container;
    
                if ( wo.scroller_fixedColumns === 0 ) {
                    ts.scroller.removeFixed( c, wo );
    Severity: Major
    Found in game/static/game/js/widget-scroller.js - About 5 hrs to fix

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

              setup : function( c, wo ) {
                  var maxHt, tbHt, $hdr, $t, $hCells, $fCells, $tableWrap, tmp,
                      $win = $( window ),
                      namespace = c.namespace + 'tsscroller',
                      $foot = $(),
      Severity: Major
      Found in game/static/game/js/widget-scroller.js - About 4 hrs to fix

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

                resize : function( c, wo ) {
                    var index, borderWidth, setWidth, $hCells, $bCells, $fCells, $headers, $this, temp,
                        $table = c.$table,
                        $tableWrap = $table.parent(),
                        $hdr = wo.scroller_$header,
        Severity: Major
        Found in game/static/game/js/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, $fixedContainer,
                          $table = c.$table,
                          $wrapper = wo.scroller_$container,
                          fixedColumns = wo.scroller_fixedColumns;
          Severity: Major
          Found in game/static/game/js/widget-scroller.js - About 2 hrs to fix

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

                    bindFixedColumnEvents : function( c, wo ) {
                        // update thead & tbody in fixed column
                        var namespace = c.namespace + 'tsscrollerFixed',
                            events = ( 'tablesorter-initialized sortEnd filterEnd ' ).split( ' ' ).join( namespace + ' ' ),
                            events2 = 'scroll' + namespace,
            Severity: Major
            Found in game/static/game/js/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 game/static/game/js/widget-scroller.js - About 1 hr to fix

                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 game/static/game/js/widget-scroller.js and 2 other locations - About 35 mins to fix
                game/static/game/js/widget-scroller.js on lines 838..842
                game/static/game/js/widget-scroller.js on lines 852..856

                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 game/static/game/js/widget-scroller.js and 2 other locations - About 35 mins to fix
                game/static/game/js/widget-scroller.js on lines 828..832
                game/static/game/js/widget-scroller.js on lines 852..856

                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 game/static/game/js/widget-scroller.js and 2 other locations - About 35 mins to fix
                game/static/game/js/widget-scroller.js on lines 828..832
                game/static/game/js/widget-scroller.js on lines 838..842

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

                                            $temp = $fixHead.eq( index )
                                                .add( $fixBody.eq( index ) )
                                                .add( $fixFoot.eq( index ) );
                Severity: Minor
                Found in game/static/game/js/widget-scroller.js and 1 other location - About 35 mins to fix
                game/static/game/js/widget-scroller.js on lines 409..411

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

                                temp = $hCells.eq( index )
                                    .add( $bCells.eq( index ) )
                                    .add( $fCells.eq( index ) );
                Severity: Minor
                Found in game/static/game/js/widget-scroller.js and 1 other location - About 35 mins to fix
                game/static/game/js/widget-scroller.js on lines 730..732

                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