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

Function count_invocation_sites

tests/test_py_lsp.c:527–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525} PyResolvedSiteCounts;
526
527static PyResolvedSiteCounts count_invocation_sites(const CBMResolvedCallArray *arr,
528 const char *caller_sub, const char *callee_sub,
529 uint32_t first_start, uint32_t first_end,
530 uint32_t second_start, uint32_t second_end) {
531 PyResolvedSiteCounts counts = {0};
532 for (int i = 0; i < arr->count; i++) {
533 const CBMResolvedCall *rc = &arr->items[i];
534 if (rc->kind != CBM_RESOLVED_INVOCATION || !rc->caller_qn || !rc->callee_qn ||
535 !strstr(rc->caller_qn, caller_sub) || !strstr(rc->callee_qn, callee_sub)) {
536 continue;
537 }
538 counts.target_count++;
539 if (rc->site_start_byte == first_start && rc->site_end_byte == first_end)
540 counts.first_site_count++;
541 if (rc->site_start_byte == second_start && rc->site_end_byte == second_end)
542 counts.second_site_count++;
543 }
544 return counts;
545}
546
547TEST(pylsp_crossfile_method_dispatch) {
548 /* file svc.py defines class RedisStore with Get(); file main.py calls

Callers 1

test_py_lsp.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected