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

Function service_edges_from

tests/test_pipeline.c:11592–11613  ·  view source on GitHub ↗

HTTP_CALLS + ASYNC_CALLS edges out of the function `source_name`. */

Source from the content-addressed store, hash-verified

11590
11591/* HTTP_CALLS + ASYNC_CALLS edges out of the function `source_name`. */
11592static int service_edges_from(cbm_store_t *s, const char *project, const char *source_name) {
11593 static const char *const types[] = {"HTTP_CALLS", "ASYNC_CALLS"};
11594 int matches = 0;
11595 for (size_t t = 0; t < sizeof(types) / sizeof(types[0]); t++) {
11596 cbm_edge_t *edges = NULL;
11597 int edge_count = 0;
11598 if (cbm_store_find_edges_by_type(s, project, types[t], &edges, &edge_count) !=
11599 CBM_STORE_OK) {
11600 return -1;
11601 }
11602 for (int i = 0; i < edge_count; i++) {
11603 cbm_node_t source = {0};
11604 if (cbm_store_find_node_by_id(s, edges[i].source_id, &source) == CBM_STORE_OK &&
11605 source.name && strcmp(source.name, source_name) == 0) {
11606 matches++;
11607 }
11608 cbm_node_free_fields(&source);
11609 }
11610 cbm_store_free_edges(edges, edge_count);
11611 }
11612 return matches;
11613}
11614
11615/* IMPORTS edges out of `file_path` that bind `local_name`; -1 on a failed query. */
11616static int imports_binding_count(cbm_store_t *s, const char *project, const char *file_path,

Callers 1

test_pipeline.cFile · 0.85

Calls 4

cbm_node_free_fieldsFunction · 0.85
cbm_store_free_edgesFunction · 0.85

Tested by

no test coverage detected