Score a candidate for tiebreaking. Higher = better. * Layer 1: Non-test code preferred over test code (+1000) * Layer 2: Namespace proximity via common prefix length (+plen) */
| 153 | * Layer 1: Non-test code preferred over test code (+1000) |
| 154 | * Layer 2: Namespace proximity via common prefix length (+plen) */ |
| 155 | static int candidate_score(const char *candidate_qn, const char *module_qn) { |
| 156 | int score = 0; |
| 157 | if (!is_test_qn(candidate_qn)) { |
| 158 | score += REG_TEST_PENALTY; |
| 159 | } |
| 160 | score += common_prefix_len(candidate_qn, module_qn); |
| 161 | return score; |
| 162 | } |
| 163 | |
| 164 | /* Pick candidate with highest composite score (test-deprioritization + namespace proximity). */ |
| 165 | static const char *best_by_import_distance(const char **candidates, int count, |
no test coverage detected