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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codereporter-0.2.6-py3-none-any.whl.
File metadata
- Download URL: codereporter-0.2.6-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf1ba2502725ac76aa5c98f1a097e3fd4f821fc5ca6dd48f19d3e7e9f4385baa
|
|
| MD5 |
e67ff7a98bb0016eaceaf8e2fd547e28
|
|
| BLAKE2b-256 |
fe37130445935b3e4f52e461c41d0a166eb657989850402541736b0ff6c299ec
|