Is `kind` a chained member/subscript access node? Language-agnostic generic set covering the common grammars; used only for the structural "access depth" smell, so unmatched grammars simply report 0 (never wrong, just silent).
| 558 | // set covering the common grammars; used only for the structural "access depth" |
| 559 | // smell, so unmatched grammars simply report 0 (never wrong, just silent). |
| 560 | static bool is_member_access_node(const char *kind) { |
| 561 | static const char *const access[] = {"member_expression", |
| 562 | "field_expression", |
| 563 | "selector_expression", |
| 564 | "field_access", |
| 565 | "member_access_expression", |
| 566 | "navigation_expression", |
| 567 | "attribute", |
| 568 | "subscript_expression", |
| 569 | "subscript", |
| 570 | "index_expression", |
| 571 | "element_access_expression", |
| 572 | "scoped_identifier", |
| 573 | NULL}; |
| 574 | for (const char *const *a = access; *a; a++) { |
| 575 | if (strcmp(kind, *a) == 0) { |
| 576 | return true; |
| 577 | } |
| 578 | } |
| 579 | return false; |
| 580 | } |
| 581 | |
| 582 | // One traversal computing cyclomatic + cognitive + loop-nesting + access-depth |
| 583 | // metrics. Each frame carries its branch-, loop- and access-nesting depth so |
no outgoing calls
no test coverage detected