repowiseollama/ollama

ollama / ollama

gomain2cd63f7328.4K linessynced 4d ago

Code health

6.1out of 10Fair

Hotspots average 4.3, the place fixes pay off most.

Explore this codebase

Do next · 4

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

Worth planning

  • Break up chat (CCN 128, 492 lines)

    app/ui/ui.go:785

    chat nests deeply; easier to read and change once split, which also removes a duplicate; function changed in 5 commits; its file is imported by 5 files, changed 10 times in 90 days.

    gain
    up to +0.7 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 128, 492 lines, nests 7 deep
    severity
    high
    worth a check
  • Start breaking up FromChatRequest (CCN 53, 171 lines): first lift lines 734-786

    openai/openai.go:734

    FromChatRequest nests deeply; easier to read and change once split, which also removes a duplicate; function changed in 26 commits; its file is imported by 18 files, changed 10 times in 90 days.

    gain
    up to +1.1 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 53, 171 lines, nests 8 deep
    severity
    high
    worth a check
  • Tidy the code shape this week's commits left: 15 findings in 12 files

    5 commits in the last 7 days added or worsened long, complex or deeply nested code, still open. Start with mlxrunner/model/nemotron_h/nemotron_h.go (2 findings): tidying it while the change is fresh costs less than after the next one.

    code-shape findings
    15
    files
    12
    commits
    5
  • Break up Completion (CCN 52, 214 lines)

    llm/llama_server.go:1852

    Completion nests deeply; easier to read and change once split, which also removes a duplicate; function changed in 8 commits; its file is imported by 56 files, changed 16 times in 90 days.

    gain
    up to +0.3 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 52, 214 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

6 areas