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

Function tc_body_owner

tests/test_test_conventions.c:129–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129static bool tc_body_owner(const CBMFileResult *result, const char *source,
130 const char *name, unsigned line) {
131 const CBMDefinition *def = tc_def(result, name);
132 if (!def || !def->qualified_name) return false;
133 int calls = 0, usages = 0;
134 for (int i = 0; i < result->calls.count; i++) {
135 const CBMCall *call = &result->calls.items[i];
136 if (call->source_origin != CBM_SOURCE_ORIGIN_RAW || call->start_line != (int)line ||
137 !tc_text(call->callee_name, "sink")) continue;
138 if (!tc_text(call->enclosing_func_qn, def->qualified_name)) return false;
139 calls++;
140 }
141 for (int i = 0; i < result->usages.count; i++) {
142 const CBMUsage *usage = &result->usages.items[i];
143 if (usage->source_origin != CBM_SOURCE_ORIGIN_RAW ||
144 tc_line_at(source, usage->site_start_byte) != line ||
145 !tc_text(usage->ref_name, "payload")) continue;
146 if (!tc_text(usage->enclosing_func_qn, def->qualified_name)) return false;
147 usages++;
148 }
149 return calls > 0 && usages > 0;
150}
151
152/* A configured form the extractor cannot map is detected with its exact
153 * status and location, then degrades the FILE (user decision 2026-10-04):

Callers 1

Calls 3

tc_defFunction · 0.85
tc_textFunction · 0.85
tc_line_atFunction · 0.85

Tested by

no test coverage detected