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).
| 734 | // set covering the common grammars; used only for the structural "access depth" |
| 735 | // smell, so unmatched grammars simply report 0 (never wrong, just silent). |
| 736 | static bool is_member_access_node(const char *kind) { |
| 737 | static const char *const access[] = {"member_expression", |
| 738 | "field_expression", |
| 739 | "selector_expression", |
| 740 | "field_access", |
| 741 | "member_access_expression", |
| 742 | "navigation_expression", |
| 743 | "attribute", |
| 744 | "subscript_expression", |
| 745 | "subscript", |
| 746 | "index_expression", |
| 747 | "element_access_expression", |
| 748 | "scoped_identifier", |
| 749 | NULL}; |
| 750 | for (const char *const *a = access; *a; a++) { |
| 751 | if (strcmp(kind, *a) == 0) { |
| 752 | return true; |
| 753 | } |
| 754 | } |
| 755 | return false; |
| 756 | } |
| 757 | |
| 758 | // One traversal computing cyclomatic + cognitive + loop-nesting + access-depth |
| 759 | // metrics. Each frame carries its branch-, loop- and access-nesting depth so |
no outgoing calls
no test coverage detected