lib/swift-search.js
Function swiftsearch
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function swiftsearch(needle, haystacks, include_non_matches, result_limit) {
haystacks = haystacks || [];
needle = String(needle || '');
if(!(haystacks instanceof Array)) {
Function sortSearchResults
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sortSearchResults(a, b) {
var tmp_a;
var tmp_b;
tmp_a = -a.longest_match;
Avoid deeply nested control flow statements. Open
Open
if(tmp_a === tmp_b) {
tmp_a = a.index;
tmp_b = b.index;
if(tmp_a === tmp_b) {