fix: Keep Go and C# complexity checks under fifteen

Merged
HA
4mo ago
+5101-3358

Summary

  • Keep Go and C# code complexity checks aligned at a stricter threshold of 15.
  • Reduce existing complexity hotspots so the new threshold passes cleanly across the branch.

User Impact

  • Contributors get earlier feedback when Go or C# code grows too complex to review safely.
  • The project now has a consistent complexity gate for CLI and Unity package code before review and CI.

Changes

  • Split high-complexity Go CLI flows into smaller dispatch, retry, launch option, metadata, and error classification helpers.
  • Split high-complexity Unity C# parsing, migration planning, input replay, mouse UI, and dynamic-code response paths into smaller helpers.
  • Update the complexity script, CI artifact generation, Go cyclop config, and C# CA1502 defaults to use 15.

Verification

  • CODE_COMPLEXITY_FAIL_ON_EXCEEDED=true scripts/check-code-complexity.sh
  • scripts/check-go-cli.sh
  • dotnet test tests/UnityCliLoop.CodeComplexity.Tests/UnityCliLoop.CodeComplexity.Tests.csproj --configuration Release
  • cli/dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)"
  • cli/dist/darwin-arm64/uloop run-tests --project-path "$(git rev-parse --show-toplevel)" --test-mode EditMode --filter-type regex --filter-value ".*(SourceShaperTests|PreUsingResolver.*Tests|DynamicCodeLiteralHoisterTests|ExecuteDynamicCodeUseCaseTests|ControlPlayModeUseCaseTests|ThirdPartyToolMigrationRulesTests|ThirdPartyToolMigrationFileServiceTests).*"
  • cli/dist/darwin-arm64/uloop run-tests --project-path "$(git rev-parse --show-toplevel)" --test-mode PlayMode --filter-type regex --filter-value ".*SimulateMouseUiTests.*"
  • /Users/a12115/dotfiles/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/v3-beta