Every displayed finding carries an actual edge-id path directed from the * dependent to the selection. IMPORTS is a dependency, never a data flow. */
| 80 | /* Every displayed finding carries an actual edge-id path directed from the |
| 81 | * dependent to the selection. IMPORTS is a dependency, never a data flow. */ |
| 82 | static yyjson_mut_val *ia_finding(yyjson_mut_doc *doc, ia_node_t *nodes, int index) { |
| 83 | ia_node_t *node = &nodes[index]; |
| 84 | yyjson_mut_val *obj = ia_node_json(doc, node); |
| 85 | yyjson_mut_obj_add_int(doc, obj, "distance", node->distance); |
| 86 | yyjson_mut_obj_add_bool(doc, obj, "test_candidate", cbm_is_test_file_path(node->file)); |
| 87 | yyjson_mut_val *path = yyjson_mut_arr(doc); |
| 88 | for (int cursor = index; nodes[cursor].parent >= 0; cursor = nodes[cursor].parent) { |
| 89 | ia_node_t *from = &nodes[cursor], *to = &nodes[from->parent]; |
| 90 | yyjson_mut_val *edge = yyjson_mut_obj(doc); |
| 91 | yyjson_mut_obj_add_int(doc, edge, "edge_id", from->edge_id); |
| 92 | yyjson_mut_obj_add_strcpy(doc, edge, "type", from->type); |
| 93 | yyjson_mut_obj_add_val(doc, edge, "from", ia_node_json(doc, from)); |
| 94 | yyjson_mut_obj_add_val(doc, edge, "to", ia_node_json(doc, to)); |
| 95 | yyjson_mut_arr_append(path, edge); |
| 96 | } |
| 97 | yyjson_mut_obj_add_val(doc, obj, "path", path); |
| 98 | return obj; |
| 99 | } |
| 100 | |
| 101 | static int ia_deadline(void *arg) { |
| 102 | return time(NULL) >= *(time_t *)arg; |
no test coverage detected