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

Function accumulate_control_flow

src/semantic/ast_profile.c:145–165  ·  view source on GitHub ↗

Count control-flow statement kinds (if/for/while/switch/try/return). */

Source from the content-addressed store, hash-verified

143
144/* Count control-flow statement kinds (if/for/while/switch/try/return). */
145static void accumulate_control_flow(const char *kind, cbm_ast_profile_t *out, bool *in_return) {
146 if (is_control_if(kind)) {
147 out->if_count++;
148 }
149 if (is_control_for(kind)) {
150 out->for_count++;
151 }
152 if (is_control_while(kind)) {
153 out->while_count++;
154 }
155 if (is_control_switch(kind)) {
156 out->switch_count++;
157 }
158 if (is_control_try(kind)) {
159 out->try_count++;
160 }
161 if (is_return(kind)) {
162 out->return_count++;
163 *in_return = true;
164 }
165}
166
167/* Count expression- and literal-class counters for one node. */
168static void accumulate_expressions(const char *kind, cbm_ast_profile_t *out) {

Callers 1

cbm_ast_profile_computeFunction · 0.85

Calls 6

is_control_ifFunction · 0.85
is_control_forFunction · 0.85
is_control_whileFunction · 0.85
is_control_switchFunction · 0.85
is_control_tryFunction · 0.85
is_returnFunction · 0.85

Tested by

no test coverage detected