A display name with context when the bare name is ambiguous: dunders and * very short names get their file stem prefixed ("datastructures.__init__"), * because "__init__ → clone" teaches nobody anything. */
| 612 | * very short names get their file stem prefixed ("datastructures.__init__"), |
| 613 | * because "__init__ → clone" teaches nobody anything. */ |
| 614 | static void fl_display_name(const flow_node_t *node, char *out, size_t cap) { |
| 615 | const char *name = node->name ? node->name : "?"; |
| 616 | bool ambiguous = name[0] == '_' || strlen(name) <= 3; |
| 617 | if (ambiguous && node->file_path) { |
| 618 | const char *base = strrchr(node->file_path, '/'); |
| 619 | base = base ? base + 1 : node->file_path; |
| 620 | char stem[128]; |
| 621 | snprintf(stem, sizeof(stem), "%s", base); |
| 622 | char *dot = strrchr(stem, '.'); |
| 623 | if (dot && dot != stem) |
| 624 | *dot = '\0'; |
| 625 | snprintf(out, cap, "%s.%s", stem, name); |
| 626 | return; |
| 627 | } |
| 628 | snprintf(out, cap, "%s", name); |
| 629 | } |
| 630 | |
| 631 | char *cbm_atlas_flows_json(cbm_store_t *store, const char *project) { |
| 632 | if (!store || !project) |
no outgoing calls
no test coverage detected