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

Function calls_edge_targets

tests/test_lang_contract.c:1502–1524  ·  view source on GitHub ↗

True if some CALLS edge's TARGET node carries `label` and a QN ending with * `qn_suffix` — i.e. the call resolved to that specific definition. */

Source from the content-addressed store, hash-verified

1500/* True if some CALLS edge's TARGET node carries `label` and a QN ending with
1501 * `qn_suffix` — i.e. the call resolved to that specific definition. */
1502static int calls_edge_targets(cbm_store_t *store, const char *project, const char *label,
1503 const char *qn_suffix) {
1504 cbm_edge_t *edges = NULL;
1505 int n = 0;
1506 if (cbm_store_find_edges_by_type(store, project, "CALLS", &edges, &n) != CBM_STORE_OK)
1507 return 0;
1508 int found = 0;
1509 size_t sl = strlen(qn_suffix);
1510 for (int i = 0; i < n && !found; i++) {
1511 cbm_node_t tgt;
1512 if (cbm_store_find_node_by_id(store, edges[i].target_id, &tgt) != CBM_STORE_OK)
1513 continue;
1514 const char *qn = tgt.qualified_name;
1515 if (qn && tgt.label && strcmp(tgt.label, label) == 0) {
1516 size_t ql = strlen(qn);
1517 if (ql >= sl && strcmp(qn + ql - sl, qn_suffix) == 0)
1518 found = 1;
1519 }
1520 cbm_node_free_fields(&tgt);
1521 }
1522 cbm_store_free_edges(edges, n);
1523 return found;
1524}
1525
1526/* #988: `from m import f as g; g()` produced NO CALLS edge — the Python LSP
1527 * bound the alias as MODULE("m.f") (the from-style heuristic keys on the

Callers 1

Calls 4

cbm_node_free_fieldsFunction · 0.85
cbm_store_free_edgesFunction · 0.85

Tested by

no test coverage detected