| 4941 | } php_file_edge_count_t; |
| 4942 | |
| 4943 | static void php_count_source_edges(const cbm_gbuf_node_t *source, void *ud) { |
| 4944 | php_file_edge_count_t *c = ud; |
| 4945 | if (!source->file_path || strcmp(source->file_path, c->src_rel) != 0) |
| 4946 | return; |
| 4947 | c->source_nodes++; |
| 4948 | const cbm_gbuf_edge_t **edges = NULL; |
| 4949 | int count = 0; |
| 4950 | if (cbm_gbuf_find_edges_by_source_type(c->gbuf, source->id, c->type, &edges, &count) != 0) { |
| 4951 | c->query_failed = true; |
| 4952 | return; |
| 4953 | } |
| 4954 | for (int i = 0; i < count; i++) { |
| 4955 | const cbm_gbuf_node_t *target = cbm_gbuf_find_by_id(c->gbuf, edges[i]->target_id); |
| 4956 | if (!target) { |
| 4957 | c->query_failed = true; |
| 4958 | } else if (target->file_path && strcmp(target->file_path, c->tgt_rel) == 0) { |
| 4959 | c->count++; |
| 4960 | } |
| 4961 | } |
| 4962 | } |
| 4963 | |
| 4964 | static int php_file_edges(const cbm_gbuf_t *gbuf, const char *type, const char *source, |
| 4965 | const char *target) { |
nothing calls this directly
no test coverage detected