18F/continua11y

View on GitHub
public/js/jquery.tablesorter.widgets.js

Summary

Maintainability
F
2 wks
Test Coverage

File jquery.tablesorter.widgets.js has 2201 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*** This file is dynamically generated ***
█████▄ ▄████▄   █████▄ ▄████▄ ██████   ███████▄ ▄████▄ █████▄ ██ ██████ ██  ██
██  ██ ██  ██   ██  ██ ██  ██   ██     ██ ██ ██ ██  ██ ██  ██ ██ ██     ██  ██
██  ██ ██  ██   ██  ██ ██  ██   ██     ██ ██ ██ ██  ██ ██  ██ ██ ██▀▀   ▀▀▀▀██
█████▀ ▀████▀   ██  ██ ▀████▀   ██     ██ ██ ██ ▀████▀ █████▀ ██ ██     █████▀
Severity: Major
Found in public/js/jquery.tablesorter.widgets.js - About 6 days to fix

    Function findRows has 179 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        findRows: function( table, filters, combinedFilters ) {
            if ( table.config.lastCombinedFilter === combinedFilters ||
                !table.config.widgetOptions.filter_initialized ) {
                return;
            }
    Severity: Major
    Found in public/js/jquery.tablesorter.widgets.js - About 7 hrs to fix

      Function init has 164 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          init: function( table, c, wo ) {
              // filter language options
              ts.language = $.extend( true, {}, {
                  to  : 'to',
                  or  : 'or',
      Severity: Major
      Found in public/js/jquery.tablesorter.widgets.js - About 6 hrs to fix

        Function format has 155 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            format: function(table, c, wo) {
                // filter widget doesn't initialize on an empty table. Fixes #449
                if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
                    return;
                }
        Severity: Major
        Found in public/js/jquery.tablesorter.widgets.js - About 6 hrs to fix

          Function processRow has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              processRow: function( c, data, vars ) {
                  var columnIndex, hasSelect, result, val, filterMatched,
                      fxn, ffxn, txt,
                      regex = ts.filter.regex,
                      wo = c.widgetOptions,
          Severity: Major
          Found in public/js/jquery.tablesorter.widgets.js - About 4 hrs to fix

            Function format has 91 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                format: function(table, c, wo) {
                    var i, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme,
                        themesAll = ts.themes,
                        $table = c.$table.add( $( c.namespace + '_extra_table' ) ),
                        $headers = c.$headers.add( $( c.namespace + '_extra_headers' ) ),
            Severity: Major
            Found in public/js/jquery.tablesorter.widgets.js - About 3 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                              if ( searchFiltered ) {
                                  // cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669
                                  for ( indx = 0; indx < columnIndex + 1; indx++ ) {
                                      val = filters[indx] || '';
                                      // break out of loop if we've already determined not to search filtered rows
              Severity: Critical
              Found in public/js/jquery.tablesorter.widgets.js - About 3 hrs to fix

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

                ts.getFilters = function( table, getRaw, setFilters, skipFirst ) {
                    var i, $filters, $column, cols,
                        filters = false,
                        c = table ? $( table )[0].config : '',
                        wo = c ? c.widgetOptions : '';
                Severity: Major
                Found in public/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

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

                      buildRow: function( table, c, wo ) {
                          var col, column, $header, buildSelect, disabled, name, ffxn, tmp,
                              // c.columns defined in computeThIndexes()
                              cellFilter = wo.filter_cellFilter,
                              columns = c.columns,
                  Severity: Major
                  Found in public/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

                    Function getOptionSource has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        getOptionSource: function( table, column, onlyAvail ) {
                            table = $( table )[0];
                            var cts, txt, indx, len,
                                c = table.config,
                                wo = c.widgetOptions,
                    Severity: Major
                    Found in public/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

                      Function bindings has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          bindings : function( c, wo ) {
                              var namespace = c.namespace + 'tsresize';
                              wo.$resizable_container.children().bind( 'mousedown', function( event ) {
                                  // save header cell and mouse position
                                  var column,
                      Severity: Major
                      Found in public/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

                        Function buildSelect has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            buildSelect: function( table, column, arry, updating, onlyAvail ) {
                                table = $( table )[0];
                                column = parseInt( column, 10 );
                                if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) {
                                    return;
                        Severity: Major
                        Found in public/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

                          Function init has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              init : function( c, wo ) {
                                  if ( c.$table.hasClass( 'hasResizable' ) ) { return; }
                                  c.$table.addClass( 'hasResizable' );
                          
                                  var noResize, $header, column, storedSizes, tmp,
                          Severity: Major
                          Found in public/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) {
                                        wo.uitheme_applied = true;
                                        oldtheme = themesAll[c.appliedTheme] || {};
                                        hasOldTheme = !$.isEmptyObject(oldtheme);
                                        oldremove =  hasOldTheme ? [ oldtheme.sortNone, oldtheme.sortDesc, oldtheme.sortAsc, oldtheme.active ].join( ' ' ) : '';
                            Severity: Critical
                            Found in public/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

                              Function storage has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              ts.storage = function(table, key, value, options) {
                                  table = $(table)[0];
                                  var cookieIndex, cookies, date,
                                      hasStorage = false,
                                      values = {},
                              Severity: Minor
                              Found in public/js/jquery.tablesorter.widgets.js - About 2 hrs to fix

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

                                    bindSearch: function( table, $el, internal ) {
                                        table = $( table )[0];
                                        $el = $( $el ); // allow passing a selector string
                                        if ( !$el.length ) { return; }
                                        var tmp,
                                Severity: Minor
                                Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                  Function checkFilters has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      checkFilters: function( table, filter, skipFirst ) {
                                          var c = table.config,
                                              wo = c.widgetOptions,
                                              filterArray = $.isArray( filter ),
                                              filters = ( filterArray ) ? filter : ts.getFilters( table, true ),
                                  Severity: Minor
                                  Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                    Function multipleColumns has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        multipleColumns: function( c, $input ) {
                                            // look for multiple columns '1-3,4-6,8' in data-column
                                            var temp, ranges, range, start, end, singles, i, indx, len,
                                                wo = c.widgetOptions,
                                                // only target 'all' column inputs on initialization
                                    Severity: Minor
                                    Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                      Function format has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          format: function(table, c, wo) {
                                              var $tbody, tbodyIndex, $rows, rows, $row, $cells, remove, indx,
                                                  $table = c.$table,
                                                  $tbodies = c.$tbodies,
                                                  sortList = c.sortList,
                                      Severity: Minor
                                      Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                        Function addHeaderResizeEvent has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        ts.addHeaderResizeEvent = function(table, disable, settings) {
                                            table = $(table)[0]; // make sure we're using a dom element
                                            if ( !table.config ) { return; }
                                            var defaults = {
                                                    timer : 250
                                        Severity: Minor
                                        Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

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

                                              format: function(table, c, wo, init) {
                                                  var stored, time,
                                                      $table = c.$table,
                                                      saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
                                                      sortList = { "sortList" : c.sortList };
                                          Severity: Minor
                                          Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                            Consider simplifying this complex logical expression.
                                            Open

                                                        } else if ( this.value !== '' && (
                                                            // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
                                                            ( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) ||
                                                            // let return & backspace continue on, but ignore arrows & non-valid characters
                                                            ( event.which !== 13 && event.which !== 8 &&
                                            Severity: Critical
                                            Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                              Function operators has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      operators: function( c, data ) {
                                                          // ignore empty strings... because '' < 10 is true
                                                          if ( /^[<>]=?/.test( data.iFilter ) && data.iExact !== '' ) {
                                                              var cachedValue, result, txt,
                                                                  table = c.table,
                                              Severity: Minor
                                              Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                                Function hideFilters has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    hideFilters: function( table, c ) {
                                                        var timer;
                                                        c.$table
                                                            .find( '.' + tscss.filterRow )
                                                            .bind( 'mouseenter mouseleave', function( e ) {
                                                Severity: Minor
                                                Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

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

                                                      mouseMove : function( c, wo, event ) {
                                                          if ( wo.resizable_.mouseXPosition === 0 || !wo.resizable_.$target ) { return; }
                                                          // resize columns
                                                          var column,
                                                              total = 0,
                                                  Severity: Minor
                                                  Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

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

                                                        setHandlePosition : function( c, wo ) {
                                                            var startPosition,
                                                                hasScroller = ts.hasWidget( c.table, 'scroller' ),
                                                                tableHeight = c.$table.height(),
                                                                $handles = wo.$resizable_container.children(),
                                                    Severity: Minor
                                                    Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

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

                                                              range : function( c, data ) {
                                                                  if ( ts.filter.regex.toTest.test( data.iFilter ) ) {
                                                                      var result, tmp, range1, range2,
                                                                          table = c.table,
                                                                          index = data.index,
                                                      Severity: Minor
                                                      Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

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

                                                                    scrollSticky = function( resizing ) {
                                                                        if (!$table.is(':visible')) { return; } // fixes #278
                                                                        // Detect nested tables - fixes #724
                                                                        nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
                                                                        var offset = $table.offset(),
                                                        Severity: Minor
                                                        Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

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

                                                          ts.resizableReset = function( table, refreshing ) {
                                                              $( table ).each(function(){
                                                                  var index, $t,
                                                                      c = this.config,
                                                                      wo = c && c.widgetOptions,
                                                          Severity: Minor
                                                          Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

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

                                                                filterInitComplete: function( c ) {
                                                                    var indx, len,
                                                                        wo = c.widgetOptions,
                                                                        count = 0,
                                                                        completed = function() {
                                                            Severity: Minor
                                                            Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

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

                                                                          setWidth = function($orig, $clone){
                                                                              var index, width, border, $cell, $this,
                                                                                  $cells = $orig.filter(':visible'),
                                                                                  len = $cells.length;
                                                                              for ( index = 0; index < len; index++ ) {
                                                              Severity: Minor
                                                              Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                                                Consider simplifying this complex logical expression.
                                                                Open

                                                                            if ( /\|/.test( data.iFilter ) || ts.filter.regex.orSplit.test( data.filter ) ) {
                                                                                var indx, filterMatched, txt, query, regex,
                                                                                    // duplicate data but split filter
                                                                                    data2 = $.extend( {}, data ),
                                                                                    index = data.index,
                                                                Severity: Major
                                                                Found in public/js/jquery.tablesorter.widgets.js - About 1 hr to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                      if ( i === c.columns && $column.length ) {
                                                                                          wo.filter_$anyMatch = $column;
                                                                                      }
                                                                  Severity: Major
                                                                  Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            if ( fxn ) {
                                                                                                // updating so the extra options are appended
                                                                                                ts.filter.buildSelect( c.table, column, '', true, $header.hasClass( wo.filter_onlyAvail ) );
                                                                                            }
                                                                    Severity: Major
                                                                    Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if ( $.isArray( setFilters ) ) {
                                                                                              // skip first ( latest input ) to maintain cursor position while typing
                                                                                              if ( skipFirst && $column.length > 1 ) {
                                                                                                  $column = $column.slice( 1 );
                                                                                              }
                                                                      Severity: Major
                                                                      Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                if ( injected ) {
                                                                                                    data.anyMatchFilter = query.join( ' && ' );
                                                                                                }
                                                                        Severity: Major
                                                                        Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                  for ( string in fxn ) {
                                                                                                      if ( typeof string === 'string' ) {
                                                                                                          options += options === '' ?
                                                                                                              '<option value="">' +
                                                                                                                  ( $header.data( 'placeholder' ) ||
                                                                          Severity: Major
                                                                          Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                    if ( wo.filter_childByColumn ) {
                                                                                                        // cycle through each child row
                                                                                                        for ( indx = 0; indx < childRow.length; indx++ ) {
                                                                                                            data.$row = childRow.eq( indx );
                                                                                                            data.cacheArray = rowData.child[ indx ];
                                                                            Severity: Major
                                                                            Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                          for (indx = 1; indx < len; indx++) {
                                                                                                              // secondary, tertiary, etc sort column classes
                                                                                                              $cells.eq(sortList[indx][0]).addClass( css[indx] || css[last] );
                                                                                                          }
                                                                              Severity: Major
                                                                              Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                        if ( !searchFiltered ) { indx = columnIndex; }
                                                                                Severity: Major
                                                                                Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                          for ( indx = 0; indx < query.length; indx++ ) {
                                                                                                              res = query[ indx ].split( ':' );
                                                                                                              if ( res.length > 1 ) {
                                                                                                                  // make the column a one-based index ( non-developers start counting from one :P )
                                                                                                                  id = parseInt( res[0], 10 ) - 1;
                                                                                  Severity: Major
                                                                                  Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                            for ( indx = 0; indx < childRow.length; indx++ ) {
                                                                                                                txt += ' ' + childRow[indx].join( '' ) || '';
                                                                                                            }
                                                                                    Severity: Major
                                                                                    Found in public/js/jquery.tablesorter.widgets.js - About 45 mins to fix

                                                                                      Consider simplifying this complex logical expression.
                                                                                      Open

                                                                                                      if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) ||
                                                                                                          typeof filters[c.columns] !== 'undefined' ) {
                                                                                                          data.anyMatchFlag = true;
                                                                                                          data.anyMatchFilter = '' + (
                                                                                                              filters[ c.columns ] ||
                                                                                      Severity: Major
                                                                                      Found in public/js/jquery.tablesorter.widgets.js - About 40 mins to fix

                                                                                        Consider simplifying this complex logical expression.
                                                                                        Open

                                                                                                    if ( ts.filter.regex.andTest.test( data.filter ) ) {
                                                                                                        var indx, filterMatched, result, txt, query, regex,
                                                                                                            // duplicate data but split filter
                                                                                                            data2 = $.extend( {}, data ),
                                                                                                            index = data.index,
                                                                                        Severity: Major
                                                                                        Found in public/js/jquery.tablesorter.widgets.js - About 40 mins to fix

                                                                                          Consider simplifying this complex logical expression.
                                                                                          Open

                                                                                                      if ( ts.filter.regex.toTest.test( data.iFilter ) ) {
                                                                                                          var result, tmp, range1, range2,
                                                                                                              table = c.table,
                                                                                                              index = data.index,
                                                                                                              parsed = data.parsed[index],
                                                                                          Severity: Major
                                                                                          Found in public/js/jquery.tablesorter.widgets.js - About 40 mins to fix

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

                                                                                                buildSelect: function( table, column, arry, updating, onlyAvail ) {
                                                                                            Severity: Minor
                                                                                            Found in public/js/jquery.tablesorter.widgets.js - About 35 mins to fix

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

                                                                                                              if ( ( parsed || parser.type === 'numeric' ) && !isNaN( query ) &&
                                                                                                                  typeof data.cache !== 'undefined' ) {
                                                                                                                  cachedValue = data.cache;
                                                                                                              } else {
                                                                                                                  txt = isNaN( data.iExact ) ? data.iExact.replace( ts.filter.regex.nondigit, '' ) : data.iExact;
                                                                                              Severity: Major
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 1 hr to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 647..652

                                                                                              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 ( ( parsed || c.parsers[ index ].type === 'numeric' ) && !isNaN( range1 ) && !isNaN( range2 ) ) {
                                                                                                                  result = data.cache;
                                                                                                              } else {
                                                                                                                  tmp = isNaN( data.iExact ) ? data.iExact.replace( ts.filter.regex.nondigit, '' ) : data.iExact;
                                                                                                                  result = ts.formatFloat( tmp, table );
                                                                                              Severity: Major
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 1 hr to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 579..585

                                                                                              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

                                                                                                      id = options && options.id ||
                                                                                                          $table.attr( options && options.group || wo && wo.storage_group || 'data-table-group') ||
                                                                                                          wo && wo.storage_tableId || table.id || $('.tablesorter').index( $table ),
                                                                                              Severity: Major
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 1 hr to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 60..62

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

                                                                                              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

                                                                                                      url = options && options.url ||
                                                                                                          $table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
                                                                                                          wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
                                                                                              Severity: Major
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 1 hr to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 55..57

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

                                                                                              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

                                                                                                              wo.zebra[1] = $.trim( ' ' + wo.zebra[1].replace(' ' + oldtheme.odd, '') );
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 50 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 184..184

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

                                                                                              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

                                                                                                              wo.zebra[0] = $.trim( ' ' + wo.zebra[0].replace(' ' + oldtheme.even, '') );
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 50 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 185..185

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

                                                                                              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 ( wo.filter_$externalFilters ) {
                                                                                                          $filters = $filters && $filters.length ?
                                                                                                              $filters.add( wo.filter_$externalFilters ) :
                                                                                                              wo.filter_$externalFilters;
                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 40 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 1859..1863

                                                                                              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

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

                                                                                                      if ( wo.filter_$externalFilters ) {
                                                                                                          $filters = $filters && $filters.length ?
                                                                                                              $filters.add( wo.filter_$externalFilters ) :
                                                                                                              wo.filter_$externalFilters;
                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 40 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 1910..1914

                                                                                              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

                                                                                                                      c.$table
                                                                                                                          .find( 'thead' )
                                                                                                                          .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' )
                                                                                                                          .append( options );
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 35 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 1820..1823

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

                                                                                              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

                                                                                                                  result = c.parsers[ index ].format( '' + query[1], table, c.$headers.eq( index ), index );
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 35 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 642..642

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

                                                                                              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

                                                                                                                  result = c.parsers[ index ].format( '' + query[0], table, c.$headers.eq( index ), index );
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 35 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 644..644

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

                                                                                              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

                                                                                                          currentValue = c.$table
                                                                                                              .find( 'thead' )
                                                                                                              .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' )
                                                                                                              .val();
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 35 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 830..833

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

                                                                                              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 ( txt.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) {
                                                                                                                  t = txt.split( wo.filter_selectSourceSeparator );
                                                                                                                  val = t[0];
                                                                                                                  txt = t[1];
                                                                                                              }
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 30 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 820..824

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

                                                                                              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 ( string.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) {
                                                                                                                                  val = string.split( wo.filter_selectSourceSeparator );
                                                                                                                                  txt = val[1];
                                                                                                                                  val = val[0];
                                                                                                                              }
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 30 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 1838..1842

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

                                                                                              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

                                                                                                          options = '<option value="">' +
                                                                                                              ( node.data( 'placeholder' ) ||
                                                                                                                  node.attr( 'data-placeholder' ) ||
                                                                                                                  wo.filter_placeholder.select || ''
                                                                                                              ) + '</option>',
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 30 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 811..817

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

                                                                                              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

                                                                                                                                  '<option value="">' +
                                                                                                                                      ( $header.data( 'placeholder' ) ||
                                                                                                                                          $header.attr( 'data-placeholder' ) ||
                                                                                                                                          wo.filter_placeholder.select ||
                                                                                                                                          ''
                                                                                              Severity: Minor
                                                                                              Found in public/js/jquery.tablesorter.widgets.js and 1 other location - About 30 mins to fix
                                                                                              public/js/jquery.tablesorter.widgets.js on lines 1814..1818

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

                                                                                              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