Compute and store the structural complexity metrics for a definition. */
| 3029 | |
| 3030 | /* Compute and store the structural complexity metrics for a definition. */ |
| 3031 | static 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)". |
no test coverage detected