Be more explicit about usage during liklihood

This commit is contained in:
Joshua Clayton 2016-05-13 12:41:49 -04:00
parent 4097ac4aa8
commit 86cdd114d5
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ calculateLikelihood r =
| elixirSingleOkay r = (Low, "a class, module, or migration that often occurs in only one file")
| singleNonTestUsage r && testsExist r = (High, "only the definition and corresponding tests exist")
| doubleNonTestUsage r && testsExist r = (Medium, "only the definition and one other use, along with tests, exists")
| totalScore < 2 = (High, "used infrequently")
| totalScore < 2 = (High, "used once")
| totalScore < 6 = (Medium, "used semi-frequently")
| totalScore >= 6 = (Low, "used frequently")
| otherwise = (Unknown, "could not determine likelihood")

View File

@ -24,7 +24,7 @@ spec = parallel $
let r1Results = TermResults "method_name" r1Matches (Occurrences 1 10) (Occurrences 2 6) (Occurrences 3 16) (Removal Low "used frequently")
let r2Matches = [ TermMatch "other" "app/path/other.rb" 1 ]
let r2Results = TermResults "other" r2Matches (Occurrences 0 0) (Occurrences 1 1) (Occurrences 1 1) (Removal High "used infrequently")
let r2Results = TermResults "other" r2Matches (Occurrences 0 0) (Occurrences 1 1) (Occurrences 1 1) (Removal High "used once")
let (Right result) = parseLines input