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

Function accumulate_expressions

src/semantic/ast_profile.c:168–191  ·  view source on GitHub ↗

Count expression- and literal-class counters for one node. */

Source from the content-addressed store, hash-verified

166
167/* Count expression- and literal-class counters for one node. */
168static void accumulate_expressions(const char *kind, cbm_ast_profile_t *out) {
169 if (is_comparison(kind)) {
170 out->comparison_ops++;
171 }
172 if (is_arithmetic(kind)) {
173 out->arithmetic_ops++;
174 }
175 if (strcmp(kind, "not_operator") == 0 || strcmp(kind, "boolean_operator") == 0) {
176 out->logical_ops++;
177 }
178 if (is_assignment(kind)) {
179 out->assignment_count++;
180 out->variable_reassigns++;
181 }
182 if (is_string_lit(kind)) {
183 out->string_literals++;
184 }
185 if (is_number_lit(kind)) {
186 out->number_literals++;
187 }
188 if (is_bool_lit(kind)) {
189 out->bool_literals++;
190 }
191}
192
193/* Accumulate Halstead operator/operand counts. Leaf identifiers, literals,
194 * and booleans are "operands"; recognized statement/expression kinds are

Callers 1

cbm_ast_profile_computeFunction · 0.85

Calls 6

is_comparisonFunction · 0.85
is_arithmeticFunction · 0.85
is_assignmentFunction · 0.85
is_string_litFunction · 0.85
is_number_litFunction · 0.85
is_bool_litFunction · 0.85

Tested by

no test coverage detected