@@ -40,6 +40,7 @@ static TSNode func_name_node(TSNode node) {
4040}
4141
4242// Resolve the name node for a function, handling language-specific quirks
43+ // NOLINTNEXTLINE(readability-function-cognitive-complexity,readability-function-size)
4344static TSNode resolve_func_name (TSNode node , CBMLanguage lang , const char * source ) {
4445 const char * kind = ts_node_type (node );
4546
@@ -398,6 +399,7 @@ static bool is_js_exported(TSNode node) {
398399}
399400
400401// Extract docstring from the node's leading comment
402+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
401403static const char * extract_docstring (CBMArena * a , TSNode node , const char * source ,
402404 CBMLanguage lang ) {
403405 // Go: type_spec is inside type_declaration; comment is before type_declaration
@@ -498,6 +500,7 @@ static const char *decorator_method_name(const char *attr_text) {
498500 * Pure AST approach: walks the decorator node's call children to find:
499501 * 1. The function/attribute name → infer HTTP method
500502 * 2. The first string argument → route path */
503+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
501504static void extract_route_from_decorators (CBMArena * a , TSNode func_node , const char * source ,
502505 const CBMLangSpec * spec , const char * * out_path ,
503506 const char * * out_method ) {
@@ -583,6 +586,7 @@ static void extract_route_from_decorators(CBMArena *a, TSNode func_node, const c
583586}
584587
585588// Extract decorator names from preceding decorator/annotation nodes
589+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
586590static const char * * extract_decorators (CBMArena * a , TSNode node , const char * source ,
587591 CBMLanguage lang , const CBMLangSpec * spec ) {
588592 if (!spec -> decorator_node_types || !spec -> decorator_node_types [0 ]) {
@@ -657,6 +661,7 @@ static const char **extract_decorators(CBMArena *a, TSNode node, const char *sou
657661}
658662
659663// Extract base class names from a class node
664+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
660665static const char * * extract_base_classes (CBMArena * a , TSNode node , const char * source ,
661666 CBMLanguage lang ) {
662667 (void )lang ;
@@ -841,6 +846,7 @@ static char *clean_type_name(CBMArena *a, const char *raw) {
841846
842847// Extract param_names from a parameter list node.
843848// Returns NULL-terminated arena-allocated array.
849+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
844850static const char * * extract_param_names (CBMArena * a , TSNode params , const char * source ,
845851 CBMLanguage lang ) {
846852 (void )lang ;
@@ -910,6 +916,7 @@ static const char **extract_param_names(CBMArena *a, TSNode params, const char *
910916// Extract return_types from a return type node.
911917// Parses Go-style multi-return (T1, T2) and single return types.
912918// Returns NULL-terminated arena-allocated array.
919+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
913920static const char * * extract_return_types (CBMArena * a , TSNode rt_node , const char * source ,
914921 CBMLanguage lang ) {
915922 (void )lang ;
@@ -979,6 +986,7 @@ static const char **extract_return_types(CBMArena *a, TSNode rt_node, const char
979986
980987// Extract param_types from a parameter list node.
981988// Returns NULL-terminated arena-allocated array.
989+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
982990static const char * * extract_param_types (CBMArena * a , TSNode params , const char * source ,
983991 CBMLanguage lang ) {
984992 if (ts_node_is_null (params )) {
@@ -1131,6 +1139,7 @@ static const char **extract_param_types(CBMArena *a, TSNode params, const char *
11311139
11321140// --- Function definition extraction ---
11331141
1142+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
11341143static void extract_func_def (CBMExtractCtx * ctx , TSNode node , const CBMLangSpec * spec ) {
11351144 CBMArena * a = ctx -> arena ;
11361145
@@ -1272,6 +1281,7 @@ static void extract_func_def(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec
12721281
12731282// --- Class definition extraction ---
12741283
1284+ // NOLINTNEXTLINE(readability-function-cognitive-complexity,readability-function-size)
12751285static void extract_class_def (CBMExtractCtx * ctx , TSNode node , const CBMLangSpec * spec ) {
12761286 CBMArena * a = ctx -> arena ;
12771287 const char * kind = ts_node_type (node );
@@ -1587,6 +1597,7 @@ static TSNode find_class_body(TSNode class_node, CBMLanguage lang) {
15871597}
15881598
15891599// Helper: try to extract method name from a node, with fallbacks
1600+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
15901601static TSNode resolve_method_name (TSNode child , CBMLanguage lang ) {
15911602 TSNode name_node = func_name_node (child );
15921603 if (!ts_node_is_null (name_node )) {
@@ -1661,6 +1672,7 @@ static TSNode resolve_method_name(TSNode child, CBMLanguage lang) {
16611672}
16621673
16631674// Push a single method definition
1675+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
16641676static void push_method_def (CBMExtractCtx * ctx , TSNode child , const char * class_qn ,
16651677 const CBMLangSpec * spec , TSNode name_node ) {
16661678 CBMArena * a = ctx -> arena ;
@@ -1741,6 +1753,7 @@ static void push_method_def(CBMExtractCtx *ctx, TSNode child, const char *class_
17411753}
17421754
17431755// Extract methods inside a class body
1756+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
17441757static void extract_class_methods (CBMExtractCtx * ctx , TSNode class_node , const char * class_qn ,
17451758 const CBMLangSpec * spec ) {
17461759 TSNode body = find_class_body (class_node , ctx -> language );
@@ -1872,6 +1885,7 @@ static void extract_rust_impl(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec
18721885
18731886// --- Elixir def/defp/defmodule ---
18741887
1888+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
18751889static void extract_elixir_call (CBMExtractCtx * ctx , TSNode node , const CBMLangSpec * spec ) {
18761890 CBMArena * a = ctx -> arena ;
18771891
@@ -2049,6 +2063,7 @@ static const char *extract_java_field_name(CBMArena *a, TSNode field, const char
20492063
20502064/* ── Variable name extractors by language group ─────────────────── */
20512065
2066+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
20522067static void extract_vars_mainstream (CBMExtractCtx * ctx , TSNode node , CBMArena * a ,
20532068 const char * kind ) {
20542069 (void )kind ;
@@ -2153,6 +2168,7 @@ static void extract_vars_mainstream(CBMExtractCtx *ctx, TSNode node, CBMArena *a
21532168 }
21542169}
21552170
2171+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
21562172static void extract_vars_dynamic (CBMExtractCtx * ctx , TSNode node , CBMArena * a , const char * kind ) {
21572173 switch (ctx -> language ) {
21582174 case CBM_LANG_PHP : {
@@ -2288,6 +2304,7 @@ static void extract_vars_dynamic(CBMExtractCtx *ctx, TSNode node, CBMArena *a, c
22882304 }
22892305}
22902306
2307+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
22912308static void extract_vars_jvm (CBMExtractCtx * ctx , TSNode node , CBMArena * a ) {
22922309 switch (ctx -> language ) {
22932310 case CBM_LANG_SCALA : {
@@ -2344,6 +2361,7 @@ static void extract_vars_jvm(CBMExtractCtx *ctx, TSNode node, CBMArena *a) {
23442361 }
23452362}
23462363
2364+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
23472365static void extract_vars_config (CBMExtractCtx * ctx , TSNode node , CBMArena * a , const char * kind ) {
23482366 switch (ctx -> language ) {
23492367 case CBM_LANG_YAML : {
@@ -2652,6 +2670,7 @@ static void extract_variables(CBMExtractCtx *ctx, TSNode root, const CBMLangSpec
26522670// Extract typed struct/class fields for cross-file LSP resolution (C/C++/CUDA/Go/Java/Rust etc.)
26532671// Creates "Field" label definitions with return_type set to the field's type text.
26542672// These are later collected by DefsToLSPDefs to build FieldDefs pipe-separated strings.
2673+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
26552674static void extract_class_fields (CBMExtractCtx * ctx , TSNode class_node , const char * class_qn ,
26562675 const CBMLangSpec * spec ) {
26572676 if (!spec -> field_node_types || !spec -> field_node_types [0 ]) {
@@ -2819,6 +2838,7 @@ static void push_nested_class_nodes(TSNode body, const CBMLangSpec *spec, walk_d
28192838 }
28202839}
28212840
2841+ // NOLINTNEXTLINE(readability-function-cognitive-complexity)
28222842static void walk_defs (CBMExtractCtx * ctx , TSNode root , const CBMLangSpec * spec , int depth_unused ) {
28232843 (void )depth_unused ;
28242844 walk_defs_frame_t stack [CBM_WALK_DEFS_STACK_CAP ];
0 commit comments