refactor: reduce cognitive complexity in session-detail and acp-client #454
Reference in New Issue
Block a user
Delete Branch "fix/448-reduce-complexity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Refactor two functions to reduce their cognitive complexity below the max threshold of 15.
Why
Addresses the complexity violations flagged in issue #448 (split from #444). High complexity functions are harder to test, review, and maintain.
Changes
packages/workflow-agent-claude-code/src/session-detail.ts: Extract helper functions fromparseClaudeCodeStreamOutputto bring complexity from 37 → ≤15packages/workflow-agent-hermes/src/acp-client.ts: Extract helper functions fromhandleSessionUpdateto bring complexity from 24 → ≤15Ref
Fixes #448
LGTM ✅ 重构行为完全保留,提取函数清晰,测试覆盖充分。
⚠️ Minor
batch-solve.sh与重构无关,建议拆到单独 PR。不阻塞。