autolab/Autolab

View on GitHub
app/assets/javascripts/sorttable.js

Summary

Maintainability
B
5 hrs
Test Coverage

Function sorttables has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var sorttables = (function($) { return function() {
    $('.sortable').each(function() {

        var $table = $(this);
        $table.find('th').each(function() {
Severity: Major
Found in app/assets/javascripts/sorttable.js - About 2 hrs to fix

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

                var comparator = function(nodeA, nodeB) {
                    var a = $.trim($(nodeA).text()).toLowerCase();
                    var b = $.trim($(nodeB).text()).toLowerCase();
                    var result;
    
    
    Severity: Minor
    Found in app/assets/javascripts/sorttable.js - About 1 hr to fix

      Avoid too many return statements within this function.
      Open

                      return result;
      Severity: Major
      Found in app/assets/javascripts/sorttable.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return -1;
        Severity: Major
        Found in app/assets/javascripts/sorttable.js - About 30 mins to fix

          There are no issues that match your filters.

          Category
          Status