chore: fix biome noExcessiveCognitiveComplexity warnings #444

Closed
opened 2026-05-23 14:18:10 +00:00 by xingyue · 0 comments
Owner

`biome check` reports 14 `noExcessiveCognitiveComplexity` warnings (max: 15). Refactor these functions to reduce complexity:

cli-workflow:

  • `setup.ts:144 _discoverAgents` (32)
  • `setup.ts:296 onData` (32)
  • `setup.ts:350 cmdSetupInteractive` (41)
  • `thread.ts:465 expandValue` (19)
  • `thread.ts:585 formatThreadReadMarkdown` (28)

workflow-agent-builtin:

  • `loop.ts:74 runBuiltinLoop` (18)

workflow-agent-claude-code:

  • `session-detail.ts:74 parseClaudeCodeStreamOutput` (37)

workflow-agent-hermes:

  • `acp-client.ts:247 handleSessionUpdate` (24)

workflow-dashboard:

  • `layout/index.ts:52 assignLayers` (26)
  • `model/handlers.ts:33 onBeforeDelete` (20)
  • `model/handlers.ts:99 handleKeyDown` (23)
  • `trans/trans-in.ts:31 transIn` (33)
  • `trans/validate.ts:94 validateRoleNodes` (22)
  • `panel/add-node.tsx:22 Form` — unused parameter `state`

Strategy: extract helper functions, split large conditionals, use early returns.

\`biome check\` reports 14 \`noExcessiveCognitiveComplexity\` warnings (max: 15). Refactor these functions to reduce complexity: **cli-workflow:** - \`setup.ts:144 _discoverAgents\` (32) - \`setup.ts:296 onData\` (32) - \`setup.ts:350 cmdSetupInteractive\` (41) - \`thread.ts:465 expandValue\` (19) - \`thread.ts:585 formatThreadReadMarkdown\` (28) **workflow-agent-builtin:** - \`loop.ts:74 runBuiltinLoop\` (18) **workflow-agent-claude-code:** - \`session-detail.ts:74 parseClaudeCodeStreamOutput\` (37) **workflow-agent-hermes:** - \`acp-client.ts:247 handleSessionUpdate\` (24) **workflow-dashboard:** - \`layout/index.ts:52 assignLayers\` (26) - \`model/handlers.ts:33 onBeforeDelete\` (20) - \`model/handlers.ts:99 handleKeyDown\` (23) - \`trans/trans-in.ts:31 transIn\` (33) - \`trans/validate.ts:94 validateRoleNodes\` (22) - \`panel/add-node.tsx:22 Form\` — unused parameter \`state\` Strategy: extract helper functions, split large conditionals, use early returns.
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#444