onijim/owl-table

View on GitHub
lib/swift-search.js

Summary

Maintainability
B
5 hrs
Test Coverage

Function swiftsearch has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function swiftsearch(needle, haystacks, include_non_matches, result_limit) {
        haystacks = haystacks || [];
        needle    = String(needle || '');

        if(!(haystacks instanceof Array)) {
Severity: Major
Found in lib/swift-search.js - About 3 hrs to fix

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

        function sortSearchResults(a, b) {
            var tmp_a;
            var tmp_b;
    
            tmp_a = -a.longest_match;
    Severity: Minor
    Found in lib/swift-search.js - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                              if(tmp_a === tmp_b) {
                                  tmp_a = a.index;
                                  tmp_b = b.index;
      
                                  if(tmp_a === tmp_b) {
      Severity: Major
      Found in lib/swift-search.js - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status