Skip to main content

Generate instant HTML code-intelligence reports for any repository

Project description

codereporter

One command. Instant HTML code-intelligence report for any repository.

codereporter /path/to/your/project

Opens a self-contained dashboard in your browser with:

  • Lines of code, comment ratio, blank lines — per file and overall
  • Language breakdown with share bars and charts
  • Functions, async functions, classes — with counts
  • API endpoint detection (FastAPI, Flask, Express.js)
  • TODO / FIXME / HACK / BUG tracker with file + line references
  • Top imported packages ranked by usage frequency
  • Long-line detector (>100 chars)

Installation

pip

pip install codereporter

uv

uv pip install codereporter

from source

git clone https://github.com/yourusername/codereporter
cd codereporter
pip install -e .

Usage

# Analyse the current directory
codereporter

# Analyse a specific repo
codereporter /path/to/project

# Custom output file name
codereporter /path/to/project --output my_report.html

# Don't auto-open the browser
codereporter . --no-open

# Also dump raw JSON stats
codereporter . --json

# Show version
codereporter --version

The HTML report is written into the analysed directory (default: code_report.html) and opened in your browser automatically.


Python API

You can also use codereporter as a library:

from codereporter import count_code_stats, build_html

data = count_code_stats("/path/to/repo")

# Access structured stats
print(data["summary"]["functions"])      # total function count
print(data["by_language"]["Python"])     # per-language breakdown
print(data["todos"])                     # list of TODO/FIXME items
print(data["endpoints"])                 # list of detected API endpoints

# Generate the HTML report
html = build_html(data)
with open("report.html", "w") as f:
    f.write(html)

Data shape

count_code_stats() returns:

{
    "summary": {
        "root": str,
        "generated_at": str,   # ISO timestamp
        "files": int,
        "loc": int,            # total lines
        "blank": int,
        "comments": int,
        "code": int,
        "functions": int,
        "async_functions": int,
        "classes": int,
        "endpoints": int,
        "todos": int,
        "long_lines": int,
    },
    "by_language": {
        "Python": {"files": int, "loc": int, "code": int, "comments": int,
                   "functions": int, "classes": int, "endpoints": int},
        ...
    },
    "file_details": [
        {"path": str, "lang": str, "loc": int, "code": int, "comments": int,
         "comment_ratio": float, "functions": int, "classes": int,
         "endpoints": int, "todos": int, "long_lines": int, "max_line_len": int},
        ...  # sorted by LOC descending
    ],
    "todos": [
        {"file": str, "line": int, "tag": str, "text": str},
        ...
    ],
    "endpoints": [
        {"file": str, "line": int, "method": str, "raw": str},
        ...
    ],
    "top_imports": [("requests", 12), ("os", 9), ...],  # top 20
}

Supported languages

Python · JavaScript · TypeScript · JSX/TSX · Java · Go · Rust · C# · PHP · Ruby · Kotlin · Swift · SQL · Shell · YAML · TOML · JSON · Markdown · HTML · CSS · SCSS · Sass · Less · Vue · Svelte · C · C++


Ignored directories

.git · __pycache__ · .venv / venv / env · node_modules · dist · build · .mypy_cache · .pytest_cache · .next · .nuxt · coverage · .tox


Requirements

  • Python 3.11+
  • No external runtime dependencies (stdlib only)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codereporter-0.2.5-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file codereporter-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: codereporter-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for codereporter-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0bd53490afc1f9e3b24058d309d62c9a1122c40d9f296b8d2255f54d7362afb3
MD5 dbf993f055d737a18fad45cce04a9b48
BLAKE2b-256 7f163d32df686b778fa22b329e6c5a2c8240f5bae5eaf777b90829c55e176353

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page