`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時間
- マージ済み PR(30日)
- 87
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 が 42 日前に担当しました。 オープン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
-
add entry to blockオープン
難易度 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 日以内に返信