Skip to main content

Repository risk analysis tool (Code Periscope).

Project description

Code Periscope

Code Periscope

Code Periscope analyzes a Git repository’s history, produces a set of CSV datasets, and generates a risk-focused report that highlights “hot files/modules” (high churn, low ownership, fix-heavy change patterns, etc.).

It’s designed for quick, local exploration during engineering planning:

  • “What parts of this repo look risky right now?”
  • “Where is change volume accelerating?”
  • “Which files/modules behave like hot spots vs stable areas?”

For the technical deep dive (pipeline, datasets, metrics, report model), see: how-it-works.md.

Repository layout

This repository is a single-package project:

  • src/code_periscope/core — analytics engine (ingest, metrics, clustering, scoring) and repository cloning/caching
  • src/code_periscope/renderers — Markdown/HTML renderers for the stable report model
  • src/code_periscope/cli.py — CLI adapter (Typer/Rich)

Quickstart

Requirements

  • Python 3.11+ is the target (the codebase uses modern typing/syntax). If you use another version locally, your mileage may vary.

Install (editable)

python3 -m venv .venv
source .venv/bin/activate

make install

Run

Analyze a local repo:

# Installed CLI
code-periscope --repo /path/to/repo --out out/

# If you're running from source without installing (e.g. CI), use the module entrypoint:
python3 -m code_periscope --repo /path/to/repo --out out/

Analyze a remote repo URL (it will clone into a local cache directory):

# Installed CLI
code-periscope --git-url https://github.com/OWNER/REPO.git --out out/

# From source without installing
python3 -m code_periscope --git-url https://github.com/OWNER/REPO.git --out out/

Test

make test

Build wheels

python3 -m pip install -U build
make build

Versioning

This project currently uses a single version for the code-periscope package.

Releasing (PyPI)

Publishing is handled by .github/workflows/publish.yml.

  1. Bump version = "..." in pyproject.toml.
  2. Commit the version bump.
  3. Create and push a tag:
git tag vX.Y.Z
git push origin vX.Y.Z

The workflow will build and publish the distribution.

Required GitHub secrets

  • PYPI_API_TOKEN: PyPI API token for the code-periscope project.
  • (Optional) TEST_PYPI_API_TOKEN: token for TestPyPI, used when manually dispatching the workflow for testpypi.

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

code_periscope-0.1.0.tar.gz (43.8 kB view details)

Uploaded Source

Built Distribution

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

code_periscope-0.1.0-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

Details for the file code_periscope-0.1.0.tar.gz.

File metadata

  • Download URL: code_periscope-0.1.0.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for code_periscope-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d7cf5eb3f81f9f5c1dd87ea024b32afa336460235aaa131154eb2f63304f6033
MD5 c66a361617d3d041bc8c1d53f0cab76d
BLAKE2b-256 bf55f36825d982f31d6c91e8c046082e1dd22cb00e171f59edc68552ddc3be5f

See more details on using hashes here.

File details

Details for the file code_periscope-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: code_periscope-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for code_periscope-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e87a296e997efa27a60b71b6e4f04f8fb957e001acc465ca8a8a16652c6146ea
MD5 42a4a92e49e666ee4fb225f457a3bb7a
BLAKE2b-256 87e8d83590a96b0236a7ad09bf7448eaf4005cae40bc1cb70f4583a9537560c2

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