Skip to main content

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.

CI Status Python 3.9+ License: MIT Tests: 133 passing Coverage: 82% PyPI version Downloads

๐Ÿš€ 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

Badge Badge Badge Badge

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

![Maintainability](https://img.shields.io/badge/maintainability-B-green)
![Risk](https://img.shields.io/badge/risk-Low-green)
![Onboarding](https://img.shields.io/badge/onboarding-Easy-blue)

**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 thresholds
  • 1 = 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:

  1. Separation of concerns โ€” CLI, analysis, formatting isolated
  2. Type safety โ€” Full mypy strict mode compliance
  3. Performance โ€” Smart caching with automatic invalidation
  4. Extensibility โ€” Plugin-ready analyzer system
  5. 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:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Run tests (./scripts/check.sh)
  4. Submit a PR

For major changes, open an issue first.


๐Ÿ™ Acknowledgments

Built with:

  • uv โ€” Fast dependency management
  • Rich โ€” Beautiful terminal UI
  • Click โ€” CLI framework

Inspired by tokei and cloc.


๐Ÿ“ž Support


Made with โค๏ธ for developers who ship

Project details


Download files

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

Source Distribution

devscope-0.1.1.tar.gz (99.7 kB view details)

Uploaded Source

Built Distribution

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

devscope-0.1.1-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

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

Hashes for devscope-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ad9cd1453bfd96867ea907557224af17c9c440f10294b6e41e8f3e5b9955ace8
MD5 c415149be130c0544064008470400ba2
BLAKE2b-256 7ee5dbc8f7e37c747f9098f187fa57a34279fbadcbecc02a6e199b661ad86a7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for devscope-0.1.1.tar.gz:

Publisher: release.yml on EhsanAzish80/Devscope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for devscope-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf2a96ba158d6db462cb00133732a2f40d58707d9620ec299ae0ad52a53e80b1
MD5 5cd2a81f9943c95b719ef85a70d3fedb
BLAKE2b-256 67d352f75adc81b7fecc485f235de058c33d12599caffa22c320ded8927ab5e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for devscope-0.1.1-py3-none-any.whl:

Publisher: release.yml on EhsanAzish80/Devscope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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