A zero-config tool that analyzes any codebase and outputs beautiful terminal reports with core repository intelligence
Project description
Devscope
Universal Codebase Intelligence for CI & Teams
Analyze any repository in seconds. Get a maintainability grade, risk level, onboarding difficulty, and a CI-ready quality gate โ zero configuration.
๐ Install in 10 Seconds
pipx install devscope
devscope scan .
Or install from source:
git clone https://github.com/EhsanAzish80/Devscope.git
cd Devscope
uv sync
uv run devscope scan .
That's it. No config files. No setup. Just intelligence.
Try it now:
devscope summary --compact
Devscope: B ยท Low risk ยท Easy onboarding ยท 1.00 tests ยท 0.06s โก
๐ฏ Why devscope?
| Feature | devscope | cloc | tokei |
|---|---|---|---|
| Maintainability grade | โ A-F scoring | โ | โ |
| CI quality gate | โ Exit codes | โ | โ |
| Multi-language repo intelligence | โ Full context | โ ๏ธ Basic | โ ๏ธ Basic |
| Shareable PR summaries | โ Markdown + badges | โ | โ |
| Intelligent caching | โ 10-20x speedup | โ | โ |
| Risk & onboarding metrics | โ Built-in | โ | โ |
| Test coverage detection | โ Automatic | โ | โ |
๐ Real-World Examples
See devscope analyzing popular open-source projects:
fastapi
Devscope: A ยท Low risk ยท Moderate onboarding ยท 1.01 tests ยท 3.38s โก
django
Devscope: B ยท Low risk ยท Hard onboarding ยท 2.79 tests ยท 7.29s โก
typer
Devscope: A ยท Low risk ยท Moderate onboarding ยท 0.89 tests ยท 0.66s โก
requests
Devscope: B ยท Low risk ยท Easy onboarding ยท 1.91 tests ยท 0.15s โก
Benchmarks run on GitHub Actions (2-core Linux VM).
โก Blazing Fast
First scan:
$ devscope scan .
โ Analysis complete in 2.45s
Cached scan (same repo):
$ devscope scan .
โ Analysis complete in 0.15s (cache: 100% hit rate, ~2.3s saved)
10-20x faster on large repos. Automatic cache invalidation when files change.
๐งช Devscope Analyzing Itself
This repository is continuously analyzed by devscope.
๐ Devscope Report
Repo: Devscope
Files: 37
Lines: 7,710
Languages: Python (70%) ยท Shell (14%) ยท Markdown (8%)
Health: B (82.5)
Risk: Low
Onboarding: Easy
Tests: 1.00 ratio
Last commit: today
Top hotspot: README.md (568 LOC, Very large file (568 LOC), No nearby tests)
โก Scan time: 0.06s
This report is automatically updated on every push.
๐ก Use Cases
- CI quality gate โ Fail builds on grade drops (
--fail-under B) - PR health comment โ One-line summary in every PR (
devscope summary --compact) - Client code audit โ Instant maintainability report for stakeholders
- Monorepo onboarding โ Estimate ramp-up time for new engineers
๐ Shareable Summaries (The Viral Feature)
Embed in Your README
devscope summary --badges > HEALTH.md
Output:
## ๐ Devscope Report



**Health:** B (82.1) ยท **Risk:** Low ยท **Onboarding:** Easy
**Files:** 1,247 ยท **Lines:** 45,892 ยท **Tests:** 0.78 ratio
โก Scan time: 0.82s (cache: 100% hit rate)
PR Comment (GitHub Actions)
- name: Add health check to PR
run: |
devscope summary --compact >> $GITHUB_STEP_SUMMARY
Output:
Devscope: B ยท Low risk ยท Easy onboarding ยท 0.78 tests ยท 0.82s โก
JSON for Bots
devscope summary --json | jq '.health'
Perfect for Slack notifications, status pages, or custom integrations.
๐ Output Examples
Terminal (Default)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ devscope v0.1.0 โ
โ Code Intelligence at a glance โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ my-project
Repository my-project
Health Grade B (82.5)
Risk Level Low
Onboarding Easy
Total Files 1,247
Total Lines 45,892
Languages
Python 45.2%
TypeScript 32.8%
JavaScript 12.1%
Tests 0.78 ratio
Top Hotspot src/analyzer.py (321 LOC)
โ Analysis complete in 0.82s
Compact (for PRs)
Devscope: B ยท Low risk ยท Easy onboarding ยท 0.78 tests ยท 0.82s โก
JSON (for automation)
{
"health_score": {
"maintainability_grade": "B",
"risk_level": "Low",
"onboarding_difficulty": "Easy",
"score_breakdown": {
"overall": 82.5,
"complexity": 80.2,
"tests": 78.0,
"git_activity": 90.0
}
},
"total_files": 1247,
"total_lines": 45892,
"test_ratio": 0.78,
"scan_time": 0.82
}
๐ Full JSON Schema
{
"analysis": {
"complexity": {
"avg_file_size": 368.5,
"deep_nesting_warning": false,
"largest_files": [
{"file_path": "src/analyzer.py", "size_bytes": 9856}
],
"max_directory_depth": 3
},
"dependencies": [
{
"ecosystem": "Python",
"manifest_file": "pyproject.toml",
"dependency_count": 8,
"dependencies": ["click", "rich", "gitpython", "pathspec"]
}
],
"git_metrics": {
"is_git_repo": true,
"commit_count": 42,
"contributor_count": 2,
"days_since_last_commit": 0
},
"health_score": {
"maintainability_grade": "B",
"risk_level": "Low",
"onboarding_difficulty": "Easy",
"score_breakdown": {
"overall": 82.5,
"complexity": 80.2,
"structure": 90.0,
"tests": 78.0,
"git_activity": 90.0,
"hotspots": 85.0
}
},
"hotspots": [
{
"file_path": "src/analyzer.py",
"lines_of_code": 321,
"depth": 2,
"has_nearby_tests": true,
"reason": "Large file with high complexity",
"risk_score": 75.3
}
],
"languages": {
"Python": 52.9,
"Markdown": 17.6,
"Shell": 11.8
},
"test_metrics": {
"has_tests": true,
"test_file_count": 8,
"source_file_count": 12,
"test_ratio": 0.667
},
"cache_stats": {
"enabled": true,
"hits": 55,
"misses": 5,
"total_files": 60,
"hit_rate": 91.67,
"time_saved_estimate": 0.005
},
"total_files": 60,
"total_lines": 3800,
"scan_time": 0.15
},
"devscope_version": "0.1.0",
"schema_version": "1.0"
}
๐ค CI/CD Integration
Quality Gates with Exit Codes
Exit codes:
0= Analysis passed all thresholds1= Runtime error (invalid path, permissions)2= Threshold violated (grade/risk/onboarding)
GitHub Actions
- name: Code health check
run: |
devscope ci . \
--fail-under B \
--max-risk Medium \
--max-onboarding Moderate
If health drops below B, the job fails with exit code 2.
GitLab CI
analyze:
script:
- devscope ci . --fail-under B --json > analysis.json
artifacts:
reports:
codequality: analysis.json
Shell Script
#!/bin/bash
devscope ci . --fail-under C
if [ $? -eq 2 ]; then
echo "โ Code quality below threshold"
exit 1
fi
๐ Command Reference
devscope scan
Analyze a codebase with beautiful terminal output.
devscope scan # Current directory
devscope scan /path/to/project # Specific path
devscope scan --json # JSON output
devscope scan --basic # Fast scan (no intelligence)
devscope scan --no-git # Skip git detection
devscope scan --no-cache # Disable caching
devscope scan --clear-cache # Clear cache before scan
devscope ci
CI-optimized command (always outputs JSON).
devscope ci # Current directory
devscope ci --fail-under B # Fail if grade < B
devscope ci --max-risk High # Fail if risk > High
devscope ci --max-onboarding Hard # Fail if onboarding > Hard
devscope summary
Generate shareable summaries.
devscope summary # Markdown report
devscope summary --badges # Include shields.io badges
devscope summary --compact # One-line summary
devscope summary --json # JSON with badges
๐ Status & Quality
| Metric | Value |
|---|---|
| Tests | 133 passing |
| Coverage | 82% |
| Type checking | mypy strict mode |
| Platforms | Linux ยท macOS ยท Windows |
| Python | 3.9+ |
This project follows rigorous engineering standards:
- โ Full type annotations
- โ Comprehensive test suite
- โ Zero runtime dependencies conflicts
- โ Cross-platform compatibility tested
๐บ๏ธ Roadmap
โ Completed
- Maintainability grading (A-F)
- Risk & onboarding assessment
- CI quality gates with exit codes
- Intelligent caching (10-20x speedup)
- Shareable markdown summaries
- Shields.io badge generation
- Test coverage detection
- JSON automation API
๐ Next
- Configuration file (
.devscope.yml) - Historical trend tracking
- Team analytics dashboard
- Security scanning (CVE detection)
๐ ๏ธ Development
Quick Start
git clone https://github.com/EhsanAzish80/Devscope.git
cd Devscope
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --all-extras
uv run devscope scan
Running Tests
uv run pytest # All tests
uv run pytest --cov # With coverage
uv run pytest tests/test_analyzer.py # Specific file
Code Quality
uv run ruff format . # Format
uv run ruff check . # Lint
uv run mypy src/devscope # Type check
Project Structure
devscope/
โโโ src/devscope/
โ โโโ cli.py # Command-line interface
โ โโโ analyzer.py # Core analysis engine
โ โโโ models.py # Type-safe data models
โ โโโ formatters.py # Summary & badge generation
โ โโโ cache.py # Intelligent caching layer
โ โโโ utils.py # Shared utilities
โโโ tests/
โ โโโ test_analyzer.py
โ โโโ test_cli.py
โ โโโ test_cache.py
โ โโโ test_summary.py
โ โโโ test_ci_thresholds.py
โโโ pyproject.toml # Dependencies & config
๐๏ธ Architecture
Design principles:
- Separation of concerns โ CLI, analysis, formatting isolated
- Type safety โ Full mypy strict mode compliance
- Performance โ Smart caching with automatic invalidation
- Extensibility โ Plugin-ready analyzer system
- User experience โ Beautiful terminal output with Rich
Core components:
- Analyzer โ File system traversal, language detection, metrics calculation
- Cache Manager โ File metadata caching with invalidation on change
- Formatters โ Output generation (terminal/JSON/markdown/compact)
- CLI โ Click-based interface with rich error handling
๐ License
MIT License - see LICENSE file.
๐ค Contributing
Contributions welcome! Please:
- Fork the repo
- Create a feature branch (
git checkout -b feature/amazing) - Run tests (
./scripts/check.sh) - Submit a PR
For major changes, open an issue first.
๐ Acknowledgments
Built with:
๐ Support
- ๐ Report a bug
- ๐ก Request a feature
- ๐ Documentation
Made with โค๏ธ for developers who ship
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 Distribution
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 devscope-0.1.1.tar.gz.
File metadata
- Download URL: devscope-0.1.1.tar.gz
- Upload date:
- Size: 99.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad9cd1453bfd96867ea907557224af17c9c440f10294b6e41e8f3e5b9955ace8
|
|
| MD5 |
c415149be130c0544064008470400ba2
|
|
| BLAKE2b-256 |
7ee5dbc8f7e37c747f9098f187fa57a34279fbadcbecc02a6e199b661ad86a7f
|
Provenance
The following attestation bundles were made for devscope-0.1.1.tar.gz:
Publisher:
release.yml on EhsanAzish80/Devscope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devscope-0.1.1.tar.gz -
Subject digest:
ad9cd1453bfd96867ea907557224af17c9c440f10294b6e41e8f3e5b9955ace8 - Sigstore transparency entry: 947322128
- Sigstore integration time:
-
Permalink:
EhsanAzish80/Devscope@41e59e18a9db2d81145d98cf52cf503a41f51de4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/EhsanAzish80
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@41e59e18a9db2d81145d98cf52cf503a41f51de4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file devscope-0.1.1-py3-none-any.whl.
File metadata
- Download URL: devscope-0.1.1-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf2a96ba158d6db462cb00133732a2f40d58707d9620ec299ae0ad52a53e80b1
|
|
| MD5 |
5cd2a81f9943c95b719ef85a70d3fedb
|
|
| BLAKE2b-256 |
67d352f75adc81b7fecc485f235de058c33d12599caffa22c320ded8927ab5e1
|
Provenance
The following attestation bundles were made for devscope-0.1.1-py3-none-any.whl:
Publisher:
release.yml on EhsanAzish80/Devscope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devscope-0.1.1-py3-none-any.whl -
Subject digest:
cf2a96ba158d6db462cb00133732a2f40d58707d9620ec299ae0ad52a53e80b1 - Sigstore transparency entry: 947322141
- Sigstore integration time:
-
Permalink:
EhsanAzish80/Devscope@41e59e18a9db2d81145d98cf52cf503a41f51de4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/EhsanAzish80
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@41e59e18a9db2d81145d98cf52cf503a41f51de4 -
Trigger Event:
push
-
Statement type: