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

Function result_fingerprint

tests/test_parse_coverage.c:1124–1165  ·  view source on GitHub ↗

Everything the graph is built from except calls and usages, in order (those * two are compared site by site, sites_agree). */

Source from the content-addressed store, hash-verified

1122/* Everything the graph is built from except calls and usages, in order (those
1123 * two are compared site by site, sites_agree). */
1124static char *result_fingerprint(const CBMFileResult *r) {
1125 cov_buf_t b = {NULL, 0, 0};
1126 for (int i = 0; i < r->defs.count; i++) {
1127 const CBMDefinition *d = &r->defs.items[i];
1128 fp_s(&b, d->label);
1129 fp_s(&b, d->name);
1130 fp_s(&b, d->qualified_name);
1131 fp_s(&b, d->signature);
1132 fp_s(&b, d->return_type);
1133 fp_s(&b, d->structural_profile);
1134 fp_s(&b, d->body_tokens);
1135 cov_put(&b, "%u-%u c%d l%d\n", d->start_line, d->end_line, d->complexity, d->lines);
1136 }
1137 for (int i = 0; i < r->imports.count; i++) {
1138 fp_s(&b, r->imports.items[i].local_name);
1139 fp_s(&b, r->imports.items[i].module_path);
1140 cov_put(&b, "imp\n");
1141 }
1142 for (int i = 0; i < r->rw.count; i++) {
1143 fp_s(&b, r->rw.items[i].var_name);
1144 cov_put(&b, "rw%d\n", (int)r->rw.items[i].is_write);
1145 }
1146 for (int i = 0; i < r->type_refs.count; i++) {
1147 fp_s(&b, r->type_refs.items[i].type_name);
1148 cov_put(&b, "tref\n");
1149 }
1150 for (int i = 0; i < r->env_accesses.count; i++) {
1151 fp_s(&b, r->env_accesses.items[i].env_key);
1152 cov_put(&b, "env\n");
1153 }
1154 for (int i = 0; i < r->throws.count; i++) {
1155 fp_s(&b, r->throws.items[i].exception_name);
1156 cov_put(&b, "throw\n");
1157 }
1158 for (int i = 0; i < r->string_refs.count; i++) {
1159 fp_s(&b, r->string_refs.items[i].value);
1160 cov_put(&b, "sref%d\n", (int)r->string_refs.items[i].kind);
1161 }
1162 cov_put(&b, "ta%d it%d rc%d ib%d ch%d\n", r->type_assigns.count, r->impl_traits.count,
1163 r->resolved_calls.count, r->infra_bindings.count, r->channels.count);
1164 return b.s;
1165}
1166
1167static int has_usage_named(const CBMFileResult *r, const char *name) {
1168 for (int i = 0; i < r->usages.count; i++) {

Callers 1

Calls 2

fp_sFunction · 0.85
cov_putFunction · 0.85

Tested by

no test coverage detected