MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / php_count_source_edges

Function php_count_source_edges

tests/test_parallel.c:4943–4962  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4941} php_file_edge_count_t;
4942
4943static 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
4964static int php_file_edges(const cbm_gbuf_t *gbuf, const char *type, const char *source,
4965 const char *target) {

Callers

nothing calls this directly

Calls 2

cbm_gbuf_find_by_idFunction · 0.85

Tested by

no test coverage detected