repowisecosmicstack-labs/mercury-agent

cosmicstack-labs / mercury-agent

typescriptmain3e3b44a95.8K linessynced on Oct 14, 2026

Code health

6.5out of 10Fair

Hotspots average 4.2, the place fixes pay off most.

Explore this codebase

Do next · 4

4 things worth doing in the week to Oct 14, the last indexed commit.

Worth planning

  • Start breaking up handleMessage (CCN 481, 1,554 lines): first lift lines 2518-2528

    src/core/agent.ts:2518

    handleMessage nests deeply; easier to read and change once split, which also removes a duplicate; its file is imported by 22 files, changed 62 times in 90 days.

    gain
    up to under +0.1 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 481, 1,554 lines, nests 7 deep
    severity
    high
    worth a check
  • Start breaking up handleBotsCommand (CCN 276, 758 lines): first lift lines 496-506

    src/core/commands/bots-command.ts:496

    handleBotsCommand has many paths; easier to read and change once split, which also removes a duplicate; function changed in 7 commits; its file is imported by 3 files, changed 8 times in 90 days.

    gain
    up to +0.6 health on this file(inferred)
    finding
    Complex method
    size
    CCN 276, 758 lines, nests 4 deep
    severity
    high
    worth a check
  • Tidy the code shape this week's commits left: 31 findings in 15 files

    13 commits in the last 7 days added or worsened long, complex or deeply nested code, still open. Start with src/bots/bot-manager.ts (5 findings): tidying it while the change is fresh costs less than after the next one.

    code-shape findings
    31
    files
    15
    commits
    13
  • Break up TuiApp (CCN 301, 600 lines)

    src/ui/App.tsx:621

    TuiApp nests deeply; easier to read and change once split, which also removes a duplicate; its file is imported by 12 files, changed 34 times in 90 days.

    gain
    up to under +0.1 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 301, 600 lines, nests 5 deep
    severity
    high
    worth a check

Improve what Repowise can see

  • Add a test coverage report

    Without one, Repowise cannot tell tested code from untested code, so every test-related action says “unknown”.

    line coverage
    Unknown, no report

Everything we found

4 areas