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

Function count_method_defs_named

tests/repro/repro_issue333.c:65–75  ·  view source on GitHub ↗

* count_method_defs_named — count defs with label "Method" matching name. * Mirrors the `has_def` helper in test_extraction.c but counts all matches. */

Source from the content-addressed store, hash-verified

63 * Mirrors the `has_def` helper in test_extraction.c but counts all matches.
64 */
65static int count_method_defs_named(CBMFileResult *r, const char *name) {
66 int n = 0;
67 for (int i = 0; i < r->defs.count; i++) {
68 const CBMDefinition *d = &r->defs.items[i];
69 if (d->label && strcmp(d->label, "Method") == 0 &&
70 d->name && strcmp(d->name, name) == 0) {
71 n++;
72 }
73 }
74 return n;
75}
76
77/*
78 * count_defs_with_label — count all defs carrying the given label.

Callers 1

repro_issue333.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected