Comfy-Org / Comfy-Org/ComfyUI_frontend

groupNode.ts: 2,024 lines, 9-level nesting, no tests

Open
#11,044 0 comments 0 reactions 0 assignees View on GitHub
area:group-nodes area:testing audit:refactor code-audit
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Recommendation

### ♻️ REFACTOR: Extract widget syncing logic and flatten nesting

Three large classes with deeply nested loops and no test coverage.

## What Was Found

- **File:** `src/extensions/core/groupNode.ts` — 2,024 lines
- **Classes:** `GroupNodeBuilder`, `GroupNodeConfig`, `GroupNodeHandler`
- **Nesting:** Depth 8-9 at lines 1201-1218
- **Tests:** None

## Context

Extract widget syncing logic into a `GroupWidgetSynchronizer`. Flatten nested loops with early returns and guard clauses. This is critical functionality for group nodes that currently has zero test coverage.

---

**Category:** Refactoring Opportunity | **Confidence:** HIGH | **Tools:** Semantic analysis
_Filed by audit-code skill_

Part of #11022

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11044-groupNode-ts-2-024-lines-9-level-nesting-no-tests-33e6d73d3650818ea110eba0409f6ffd) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.