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

Function count_edges_between_nodes

tests/test_parallel.c:1232–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1230}
1231
1232static int count_edges_between_nodes(const cbm_gbuf_t *gbuf, const cbm_gbuf_node_t *source,
1233 const cbm_gbuf_node_t *target, const char *edge_type) {
1234 if (!gbuf || !source || !target || !edge_type) {
1235 return -1;
1236 }
1237 const cbm_gbuf_edge_t **edges = NULL;
1238 int count = 0;
1239 if (cbm_gbuf_find_edges_by_source_type(gbuf, source->id, edge_type, &edges, &count) != 0) {
1240 return -1;
1241 }
1242 int matches = 0;
1243 for (int i = 0; i < count; i++) {
1244 if (edges[i] && edges[i]->target_id == target->id) {
1245 matches++;
1246 }
1247 }
1248 return matches;
1249}
1250
1251static bool has_edge_from_callable_to_node(const cbm_gbuf_t *gbuf, const char *source_tail,
1252 const cbm_gbuf_node_t *target, const char *edge_type) {

Callers 1

Calls 1

Tested by

no test coverage detected