| 4214 | } |
| 4215 | |
| 4216 | static const char *coverage_status(const cbm_coverage_row_t *rows, int count, |
| 4217 | const char *requested_path, const char *recording_status, |
| 4218 | bool generation_matches, bool lookup_ok, |
| 4219 | bool exact_path_verified) { |
| 4220 | if (!lookup_ok) { |
| 4221 | return "coverage_unavailable"; |
| 4222 | } |
| 4223 | bool exact = false; |
| 4224 | for (int i = 0; i < count; i++) { |
| 4225 | if (rows[i].rel_path && strcmp(rows[i].rel_path, requested_path) == 0) { |
| 4226 | exact = true; |
| 4227 | break; |
| 4228 | } |
| 4229 | } |
| 4230 | for (int pass = 0; pass < 3; pass++) { |
| 4231 | for (int i = 0; i < count; i++) { |
| 4232 | if (exact && (!rows[i].rel_path || strcmp(rows[i].rel_path, requested_path) != 0)) { |
| 4233 | continue; |
| 4234 | } |
| 4235 | const char *kind = rows[i].kind ? rows[i].kind : ""; |
| 4236 | if (pass == 0 && strcmp(kind, "parse_partial") == 0) { |
| 4237 | return "partial"; |
| 4238 | } |
| 4239 | if (pass == 1 && strncmp(kind, "not_indexed", 11) == 0) { |
| 4240 | return "excluded"; |
| 4241 | } |
| 4242 | if (pass == 2 && kind[0]) { |
| 4243 | return "skipped"; |
| 4244 | } |
| 4245 | } |
| 4246 | } |
| 4247 | bool recording_complete = recording_status && strcmp(recording_status, "complete") == 0; |
| 4248 | bool truncated_exact_path_verified = |
| 4249 | exact_path_verified && recording_status && strcmp(recording_status, "truncated") == 0; |
| 4250 | if (!generation_matches || (!recording_complete && !truncated_exact_path_verified)) { |
| 4251 | return "coverage_unavailable"; |
| 4252 | } |
| 4253 | return "no_recorded_issue"; |
| 4254 | } |
| 4255 | |
| 4256 | static const char *coverage_recommended_action(const char *status, const char *freshness) { |
| 4257 | if (!freshness || strcmp(freshness, "metadata_match") != 0) { |
no outgoing calls
no test coverage detected