Skip to content

Split the six cognitive-complexity hotspots into options → operation → renderer #12

Description

@Vonng

Why

Measured cognitive complexity: runNetwork 157, Config.Validate 112, runImage 110, runSetupCommand 100, Manager.Up 97, runPrivateCommand 92. The CLI handlers mix argument checks, host probing, and three output formats in one body, which is why every review finds another bypass of the error layer.

Proposed shape

  • Per CLI handler: typed options (mostly present) → one domain call returning a typed result → one renderer per format.
  • runNetwork: separate install / uninstall / status handlers, per OS.
  • Manager.Up: extract the existing-state branch (diff, phase classification, the startExisting decision) into a named function shared with Reload.
  • Config.Validate remains one validator; factor the repeated node loops but do not split it to chase a number.

Acceptance

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorInternal restructuring with no user-visible change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions