mambax7/alumni-26x

View on GitHub
media/jquery/tablesorter-master/js/extras/jquery.dragtable.mod.js

Summary

Maintainability
D
2 days
Test Coverage

File jquery.dragtable.mod.js has 450 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! Dragtable Mod for TableSorter - updated 10/31/2015 (v2.24.0) *//*
 * Requires
 *   tablesorter v2.8+
 *   jQuery 1.7+
 *   jQuery UI (Core, Widget, Mouse & Sortable)
Severity: Minor
Found in media/jquery/tablesorter-master/js/extras/jquery.dragtable.mod.js - About 6 hrs to fix

    Function _generateSortable has 116 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _generateSortable: function(e) {
          if (e.cancelBubble) {
            e.cancelBubble = true;
          } else {
            e.stopPropagation();
    Severity: Major
    Found in media/jquery/tablesorter-master/js/extras/jquery.dragtable.mod.js - About 4 hrs to fix

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

          update : function( _this ) {
            var t, list, val,
              dragTable = _this.originalTable,
              table = dragTable.el[ 0 ],
              $table = $( table ),
      Severity: Major
      Found in media/jquery/tablesorter-master/js/extras/jquery.dragtable.mod.js - About 2 hrs to fix

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

            _create: function() {
              var _this = this;
              _this.originalTable = {
                el: _this.element,
                selectedHandle: $(),
        Severity: Minor
        Found in media/jquery/tablesorter-master/js/extras/jquery.dragtable.mod.js - About 1 hr to fix

          Function reindexArrayItem has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              reindexArrayItem : function( array, oldIndex, newIndex ) {
                var nIndx = $.inArray( newIndex, array ),
                  oIndx = $.inArray( oldIndex, array ),
                  max = Math.max.apply( Math, array ),
                  arry = [];
          Severity: Minor
          Found in media/jquery/tablesorter-master/js/extras/jquery.dragtable.mod.js - About 1 hr to fix

            TODO found
            Open

            /* TODO: investigate

            TODO found
            Open

                  onlyHeaderThreshold: 100,    // TODO:  not implemented yet, switch automatically between entire col moving / only header moving

            TODO found
            Open

                  restoreState: null,          // JSON-Object or function:  some kind of experimental aka Quick-Hack TODO: do it better

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

                if (body_onselectstart_save) {
                  $(document.body).attr('onselectstart', body_onselectstart_save);
                } else {
                  $(document.body).removeAttr('onselectstart');
                }
            media/jquery/tablesorter-master/js/extras/jquery.dragtable.mod.js on lines 595..599

            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

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

                if (body_unselectable_save) {
                  $(document.body).attr('unselectable', body_unselectable_save);
                } else {
                  $(document.body).removeAttr('unselectable');
                }
            media/jquery/tablesorter-master/js/extras/jquery.dragtable.mod.js on lines 590..594

            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

            There are no issues that match your filters.

            Category
            Status