Skip to content

stats --verbose: absolute paths make the table unreadable on deep directory trees #17

Closed

Description

@knight22-21

Description

Running codeprism stats --verbose on a project with deeply nested files produces an unreadable table. The Path column stores full absolute paths (e.g. /home/user/projects/myapp/src/domain/payments/processor.py) with no width constraint, so Rich wraps them mid-path across multiple lines. On a standard 120-column terminal the table becomes visually broken before the complexity scores are visible.

Steps to Reproduce

codeprism index /path/to/any/project/with/deep/nesting
codeprism stats --verbose

Observe the Path column — every deeply nested file wraps to 2–3 lines.

Expected Behaviour

Paths should be shown relative to the project root (or truncated with … for very long paths), so each file occupies exactly one row. Rich's Table supports max_width, no_wrap, and overflow="ellipsis" on individual columns.

Actual Behaviour

Full absolute paths are printed with no width cap. The table wraps aggressively and is difficult to scan.

Suggested Fix

In the stats command table construction (cli.py around the add_column("Path") call):

  1. Convert stored absolute paths to paths relative to the indexed project root before inserting into the table.
  2. Add overflow="ellipsis" (or max_width=60) to the Path column so very long relative paths still truncate gracefully.

Environment

  • codeprism-ai any version
  • Reproducible on any project with directory depth > 3–4 levels

Activity

  1. sundaysebasidian-byte commented on Oct 3, 2026

    @sundaysebasidian-byte
    Contributor

    I'd like to take this issue. I plan to display stats --verbose paths relative to the selected project root and constrain the Path column so deep paths stay on one row. I'll add regression tests using a real temporary index and finite-width rendering, then run the full suite and ruff. Codex will assist; I'll report the actual tests and any untested platforms in the draft PR.

  2. knight22-21 commented on Oct 3, 2026

    @knight22-21
    OwnerAuthor

    Thanks for taking this on! I see you have a draft PR (#73) in progress. Please complete the implementation and tests, then mark the PR as ready for review (remove the DRAFT status) so I can review and merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions