`execute` (complexity 48) and `execute_cloud` (44) in `command/run/__init__.py`
维护者通常 1 天内回复
@christian-byrne 已经在做这个了。
开始于 2026年8月23日。
评估
这个 Issue 还没有评估数据。
描述
What — The two functions on the CLI's primary command path score 48 and 44 on cyclomatic complexity, against a conventional threshold of 10. They are the top two of 90 C901 violations repo-wide; the next worst are 36 (command/generate/app.py:_generate) and 35 (command/models/models.py:download).
Why it matters here — comfy run is the command most users reach for, and its two implementations are the least testable code in the repo. At complexity 48 the branch count is beyond what a test suite can cover exhaustively, so behaviour changes there are effectively unverifiable — which is a bad property for the path that talks to both local and cloud execution. The two functions being near-twins at 48 and 44 also suggests shared structure worth extracting rather than two independent rewrites.
Evidence
$ ruff check --select C901 --output-format concise comfy_cli | sort -t'(' -k2 -rn | head -4
comfy_cli/command/run/__init__.py:204:5: C901 `execute` is too complex (48 > 10)
comfy_cli/command/run/__init__.py:890:5: C901 `execute_cloud` is too complex (44 > 10)
comfy_cli/command/generate/app.py:481:5: C901 `_generate` is too complex (36 > 10)
comfy_cli/command/models/models.py:334:5: C901 `download` is too complex (35 > 10)
$ ruff check --select C901 comfy_cli 2>&1 | tail -1
Found 90 errors.
Fix
Not a single-PR job. Suggested order: diff execute against execute_cloud to find the shared skeleton, extract it, then peel argument validation and output formatting out of both. Add C901 to ruff with max-complexity set at the current worst value so it ratchets down instead of failing on day one.
Found by repo-audit during repo improvement sweep 2026-08-17. Parent: #723
- 主要语言
- Python
- 星标
- 1k
- 派生
- 176
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 87
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Comfy-Org/comfy-cli 的其他 Issue
-
test_file_utils umask tests assert against a umask the code never reads (import-time _UMASK), so they only pass on a 0o022 host可能已有人在做 @neverbiasu 于 10 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
Comfy-Org/comfy-cli#907 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 92/100
Comfy-Org/comfy-cli#781 · 1 条评论 ·
维护者通常 1 天内回复
-
`comfy launch --background` fails with FileNotFoundError when comfy-cli is invoked by path可能已有人在做 @RaphaelFakhri 于 43 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
Comfy-Org/comfy-cli#691 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
Comfy-Org/comfy-cli#670 · 2 条评论 ·
维护者通常 1 天内回复
查看 Comfy-Org/comfy-cli 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"可能已有人在做 @0z5a 今天认领。 未关闭needs-triage
难度 2/5 半天 新手友好度 72/100
维护者通常 2 天内回复
-
plot_graph crashes when a mesh node has no m2m edge可能已有人在做 @tygvi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
mllam/neural-lam#883 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
future-agi/future-agi#4092 · 1 条评论 ·
维护者通常 1 天内回复
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld whole未关闭
难度 1/5 1 小时以内 新手友好度 82/100
WingedGuardian/GENesis-AGI#4641 ·
维护者通常 1 天内回复