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

Function cx_pyext_population

tests/test_complexity.c:517–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517static bool cx_pyext_population(cbm_store_t *store, const char *project, CxMetrics *out) {
518 cbm_node_t *nodes = NULL;
519 int count = 0;
520 bool ok = cbm_store_find_nodes_by_label(store, project, "File", &nodes, &count) == CBM_STORE_OK;
521 for (int i = 0; ok && i < count; i++) {
522 if (nodes[i].file_path && strncmp(nodes[i].file_path, "pyext/", 6) == 0)
523 out->pyext_files++;
524 }
525 cbm_store_free_nodes(nodes, count);
526 nodes = NULL;
527 count = 0;
528 ok = ok &&
529 cbm_store_find_nodes_by_label(store, project, "Function", &nodes, &count) == CBM_STORE_OK;
530 for (int i = 0; ok && i < count; i++) {
531 const cbm_node_t *node = &nodes[i];
532 if (!node->file_path || strncmp(node->file_path, "pyext/", 6) != 0 || !node->name)
533 continue;
534 static const char definition_prefix[] = "cx_pyext_definition_";
535 if (strncmp(node->name, definition_prefix, sizeof(definition_prefix) - 1) == 0)
536 out->pyext_defs++;
537 if (strcmp(node->name, "cx_pyext_use") == 0 && cx_pyext_control(store, project, node))
538 out->pyext_controls++;
539 }
540 cbm_store_free_nodes(nodes, count);
541 return ok;
542}
543
544/* Each package has many registered direct members; other packages are decoys.
545 * Wildcards precede definitions so the fixture retains explicit LSP positives.

Callers 1

cx_runFunction · 0.85

Calls 3

cbm_store_free_nodesFunction · 0.85
cx_pyext_controlFunction · 0.85

Tested by

no test coverage detected