Code quality analysis: httpie/cli static recon findings — definition.py (956 lines), 17% doc coverage

Open
#1,826 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Quiet
Tech stack
python

Research direction

Start with the ASS-ADE findings and the companion PR #1825, then inspect httpie/cli/definition.py, argtypes.py, options.py, and the listed output imports. The issue reports several possible refactors, documentation gaps, import cycles, and untested modules, but requests no specific change or completion criteria.

Written by the indexing model from the issue text.

Description

Overview

I ran ASS-ADE (pure static analysis, no LLM, < 2 seconds) on httpie and found a few things worth flagging. Opened a companion PR (#1825) with the full reports — sharing the findings here as an issue so they can be tracked and discussed independently of the PR.

Top findings

1. httpie/cli/definition.py — 956 lines, mixed responsibilities

This file combines:

  • Constant/enum declarations (belongs in constants.py)
  • Argument group builder functions (could be groups.py)
  • Top-level ParserSpec composition (the actual "definition")

At 956 lines, it's hard to navigate and test each responsibility in isolation. Splitting it into 2-3 files with a single responsibility each wouldn't change any public API.

2. Documentation coverage — 17%

Only 189 of 1,107 public callables have docstrings. The files with the most external call surface and no docs:

  • httpie/cli/argtypes.py (275 lines, type converters)
  • httpie/cli/options.py (249 lines, ParserSpec / Qualifiers)
3. Circular imports in output/

Two import cycles detected:

  • client.py → context.py → output/utils.py (possible false positive — worth verifying)
  • Self-referential import in output/formatters/xml.py
4. 66 untested modules

Most are in docs/, extras/, and tooling scripts — not the core library. The ratio for the core httpie/ package itself is better.

Recon summary

Files: 265 (135 source)
Circular deps: 2
Doc coverage: 17% (189/1107)
Untested modules: 66
Tier violations: 3 files spanning multiple layers

Tool

ASS-ADEass-ade recon <path>. Runs locally in about 1.5 seconds, no external calls. The full RECON_REPORT.md is in the companion PR.

No action required — just sharing in case any of this is useful for future work. Happy to run a follow-up analysis on a specific module if it would help.

Dominant language
Python
Stars
38.6k
Forks
4k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from httpie/cli

All issues in httpie/cli

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.