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

Function cx_pyrange_population

tests/test_complexity.c:669–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667}
668
669static bool cx_pyrange_population(cbm_store_t *store, const char *project, CxMetrics *out) {
670 static const char *const labels[] = {"File", "Function", "Class"};
671 bool ok = true;
672 for (int l = 0; l < 3; l++) {
673 cbm_node_t *nodes = NULL;
674 int count = 0;
675 bool queried = cbm_store_find_nodes_by_label(store, project, labels[l], &nodes, &count) ==
676 CBM_STORE_OK;
677 ok = queried && ok;
678 for (int i = 0; queried && i < count; i++) {
679 const cbm_node_t *node = &nodes[i];
680 if (!node->file_path || strncmp(node->file_path, "pyrange/", 8) != 0)
681 continue;
682 if (l == 0)
683 out->pyrange_files++;
684 if (l == 1 && node->name) {
685 static const char def_prefix[] = "cx_pyrange_definition_";
686 if (strncmp(node->name, def_prefix, sizeof(def_prefix) - 1) == 0)
687 out->pyrange_defs++;
688 if (strcmp(node->name, "cx_pyrange_use") == 0 &&
689 cx_pyrange_controls(store, project, node))
690 out->pyrange_controls++;
691 }
692 if (l == 2 && node->name && strncmp(node->name, "RangeClass_", 11) == 0)
693 out->pyrange_classes++;
694 if (l == 2 && node->name && strncmp(node->name, "Peer_", 5) == 0)
695 out->pyrange_peer_classes++;
696 }
697 cbm_store_free_nodes(nodes, count);
698 }
699 return ok;
700}
701
702static double cx_now_s(void) {
703 struct timespec ts;

Callers 1

cx_runFunction · 0.85

Calls 3

cx_pyrange_controlsFunction · 0.85
cbm_store_free_nodesFunction · 0.85

Tested by

no test coverage detected