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

Function set_def_complexity

internal/cbm/extract_defs.c:3031–3039  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3029
3030/* Compute and store the structural complexity metrics for a definition. */
3031static void set_def_complexity(CBMDefinition *def, TSNode body, const CBMLangSpec *spec) {
3032 cbm_complexity_t cx;
3033 cbm_compute_complexity(body, spec->branching_node_types, &cx);
3034 def->complexity = cx.cyclomatic;
3035 def->cognitive = cx.cognitive;
3036 def->loop_count = cx.loop_count;
3037 def->loop_depth = cx.loop_depth;
3038 def->max_access_depth = cx.max_access_depth;
3039}
3040
3041/* Extract the bare type name from a Go method receiver node.
3042 * 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