MCPcopy Create free account
hub / github.com/FabricMC/Matcher / checkRank

Method checkRank

src/main/java/matcher/Matcher.java:724–737  ·  view source on GitHub ↗
(List<? extends RankResult<?>> ranking, double absThreshold, double relThreshold, double maxScore)

Source from the content-addressed store, hash-verified

722 }
723
724 public static boolean checkRank(List<? extends RankResult<?>> ranking, double absThreshold, double relThreshold, double maxScore) {
725 if (ranking.isEmpty()) return false;
726
727 double score = getScore(ranking.get(0).getScore(), maxScore);
728 if (score < absThreshold) return false;
729
730 if (ranking.size() == 1) {
731 return true;
732 } else {
733 double nextScore = getScore(ranking.get(1).getScore(), maxScore);
734
735 return nextScore < score * (1 - relThreshold);
736 }
737 }
738
739 public static double getScore(double rawScore, double maxScore) {
740 double ret = rawScore / maxScore;

Callers 4

autoMatchClassesMethod · 0.95
matchMethod · 0.95
autoMatchMethodVarsMethod · 0.95
getScoreMethod · 0.95

Calls 4

getScoreMethod · 0.95
sizeMethod · 0.80
getScoreMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected