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

Function set_def_complexity

internal/cbm/extract_defs.c:3460–3468  ·  view source on GitHub ↗

Compute and store the structural complexity metrics for a definition. */

Source from the content-addressed store, hash-verified

3458
3459/* Compute and store the structural complexity metrics for a definition. */
3460static void set_def_complexity(CBMDefinition *def, TSNode body, const CBMLangSpec *spec) {
3461 cbm_complexity_t cx;
3462 cbm_compute_complexity(body, spec->branching_node_types, &cx);
3463 def->complexity = cx.cyclomatic;
3464 def->cognitive = cx.cognitive;
3465 def->loop_count = cx.loop_count;
3466 def->loop_depth = cx.loop_depth;
3467 def->max_access_depth = cx.max_access_depth;
3468}
3469
3470/* Extract the bare type name from a Go method receiver node.
3471 * The receiver is a parameter_list, e.g. "(s *OrderService)" or "(s Order)".

Callers 3

extract_func_defFunction · 0.85
push_method_defFunction · 0.85
extract_rust_implFunction · 0.85

Calls 1

cbm_compute_complexityFunction · 0.85

Tested by

no test coverage detected