Skip to content

Commit

Permalink
Enable unlimited max length difference option using 0
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Aug 12, 2018
1 parent c67ab60 commit 6151cee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/scripts/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function comparelicense(selection, spdxid, license, tabId, maxLengthDifference=1
var difference = Math.abs(count2 - count);
var locdiff = Math.abs(loc2 - loc);
var maxLength = Math.max(count, count2);
if (difference <= maxLength && difference < maxLengthDifference) {
if (difference <= maxLength && ((maxLengthDifference == 0 ) || (difference < maxLengthDifference))) {
var distance = Levenshtein.get(cleanText(data), cleanText(selection));
var percentage = ((maxLength - distance) / maxLength * 100).toFixed(1);
console.log(tabId, id, spdxid + " - Levenshtein Distance (clean): " + distance + " (" + percentage + "%)" + " Length Difference: " + difference + " LOC Diff:" + locdiff);
Expand Down

0 comments on commit 6151cee

Please sign in to comment.