Skip to content

Monolithic functions in repo.sh/gh.sh/setup_common.sh make security-relevant changes hard to review #1891

Description

@codeforester

Summary

Several of the largest Bash command files mix argument parsing, validation, external orchestration, and file writing into single, very long functions.

Details

  • cli/bash/commands/basectl/subcommands/repo.sh:2102-2572base_repo_init, 471 lines, 30+ locals (file itself is 3,177 lines).
  • cli/bash/commands/basectl/subcommands/gh.sh:892base_gh_issue_readiness, 258 lines.
  • cli/bash/commands/basectl/subcommands/setup_common.sh:1024setup_run_project_artifact_layer, 196 lines.

Impact

These functions are difficult to test in isolation, review for security-relevant changes (e.g. GitHub API/CLI orchestration), or safely modify without regressions.

Suggested fix

Decompose into smaller named steps (parse → validate → plan → execute → report), consistent with smaller functions already used elsewhere in the same files.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Projects

Status
Triage

Relationships

None yet

Development

No branches or pull requests

Issue actions