mirror of
https://github.com/joshuaclayton/unused.git
synced 2024-08-15 15:50:26 +03:00
Be more explicit about usage during liklihood
This commit is contained in:
parent
4097ac4aa8
commit
86cdd114d5
@ -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")
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user