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

Function rp_node_count

tests/repro/repro_reference_precision.c:40–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40static int rp_node_count(cbm_store_t *store, const char *project, const char *label,
41 const char *name, const char *qn_suffix) {
42 cbm_node_t *nodes = NULL;
43 int count = 0;
44 if (cbm_store_find_nodes_by_label(store, project, label, &nodes, &count) != CBM_STORE_OK)
45 return -1;
46 int matches = 0;
47 for (int i = 0; i < count; i++) {
48 if (name && (!nodes[i].name || strcmp(nodes[i].name, name) != 0))
49 continue;
50 if (qn_suffix && !rp_qn_ends_with(nodes[i].qualified_name, qn_suffix))
51 continue;
52 matches++;
53 }
54 cbm_store_free_nodes(nodes, count);
55 return matches;
56}
57
58static int rp_edge_count(cbm_store_t *store, const char *project, const char *edge_type,
59 const char *source_name, const char *target_label, const char *target_name,

Calls 3

rp_qn_ends_withFunction · 0.85
cbm_store_free_nodesFunction · 0.85

Tested by

no test coverage detected