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

Function dump_edge_histogram

tests/test_lang_contract.c:1082–1097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1080 NULL};
1081
1082static void dump_edge_histogram(cbm_store_t *store, const char *project) {
1083 if (!store) {
1084 fprintf(stderr, " └─ (no graph DB)\n");
1085 return;
1086 }
1087 char line[640] = {0};
1088 for (int i = 0; ALL_EDGE_TYPES[i]; i++) {
1089 int c = cbm_store_count_edges_by_type(store, project, ALL_EDGE_TYPES[i]);
1090 if (c > 0 && strlen(line) < sizeof(line) - 48) {
1091 char one[64];
1092 snprintf(one, sizeof(one), "%s=%d ", ALL_EDGE_TYPES[i], c);
1093 strncat(line, one, sizeof(line) - strlen(line) - 1);
1094 }
1095 }
1096 fprintf(stderr, " └─ edges produced: [%s]\n", line[0] ? line : "(none)");
1097}
1098
1099/* Index `files`, assert the named edge type appears at least `floor` times.
1100 * On failure, dump the full edge histogram so a regression is diagnosable. */

Callers 2

edge_presentFunction · 0.85

Calls 1

Tested by

no test coverage detected