Skip to main content

A Code Aging & Decay Tracker - measures software entropy per module using git analysis, dependency drift, churn ratios, and knowledge decay signals.

Project description

Entropy

Entropy - Code Aging & Decay Tracker

boto/compat.py scores 69. 490 modules depend on it. Every author who wrote it is gone. Its dependencies are years out of date. Nobody flagged this. Until now.

PyPI Python License: MIT Demo


Software does not just accumulate bugs. It ages. The library it depends on evolved. The engineers who wrote it have left. Entropy makes that risk visible — as a number, per module, before production goes down.

Entropy Report — boto


Install

pip install entropy-tracker

Requirements: Python 3.10+, Git in your system PATH. No API keys. No telemetry. Runs securely in your environment. Source code never leaves your machine. Dependency versions are checked via read-only queries to the public PyPI API.


Quick Start

entropy init ./my-repo                 # register repo + first scan
entropy report --top 10                # worst modules by decay score
entropy inspect payments/gateway.py   # full breakdown + forecast
entropy diff --base main               # entropy delta for current branch

First results in under 60 seconds on most repositories.


Sample Output

Entropy Report

Module Inspect


What It Measures

Four signals combine into one composite score (0–100):

Signal What it detects Weight
Knowledge Decay % of this file's authors who are still active in the repo 35%
Dependency Decay How far behind this module's direct dependencies are 30%
Churn-to-Touch Ratio Chaotic edits vs intentional refactors 20%
Age Without Refactor Months since the last deliberate restructure 15%

How signals are computed: Knowledge decay checks author activity within a 36-month window. Churn is classified by total lines touched (>200 = churn) vs net line change (<10 with multi-file changes = refactor) - not by commit messages, which are unreliable. Dependency checks query PyPI for current release history and pip-audit for CVE counts.

Weights reflect recovery cost. Knowledge decay has the highest weight because lost institutional knowledge is irreversible on any sprint timescale. You can update a dependency in an afternoon. You cannot rebuild three years of context in a sprint.

Scores above 85 are Critical. Above 70 are High. All weights are configurable via entropy.toml.


Does It Actually Work?

We ran Entropy across Django, boto, and requests. Files scoring above 70 showed significantly more bug-fix and hotfix commits in their history than files below 50. The correlation is not causal - high-entropy files attract bugs and are touched repeatedly to fix them, which compounds the score over time. This is the pattern Entropy is designed to surface before it becomes an incident.

The tool processed Django's 2,903 modules across 2,782 commits in 34 seconds.


CI Integration

entropy diff --base main
# Shows entropy delta for every file changed in the current branch
# .github/workflows/entropy.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0        # full history required — do not use fetch-depth: 1
- run: pip install entropy-tracker && entropy diff --base main

Performance

Repository Modules Scan Time
click 62 ~11s
Django 2,903 ~34s
boto (full history) 938 ~45s

Subsequent scans are faster — PyPI responses are cached locally for 24 hours.


Why Not SonarQube / Dependabot / CodeScene?

Tool Prevents bugs Surfaces knowledge loss risk
SonarQube
Dependabot
CodeScene Partially Partially (no dep drift, no CI diff, enterprise pricing)
Entropy

Entropy's focus is not code quality. It is the risk that comes from a module nobody fully understands anymore — which no other tool in this list measures.



Roadmap

  • entropy simulate --author-leaves alice@company.com
  • JavaScript / TypeScript support
  • GitHub Actions marketplace integration
  • Validation dataset: entropy score vs production incident correlation

Built by Hari om Singh · PyPI · MIT License

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

entropy_tracker-1.0.3.tar.gz (48.0 kB view details)

Uploaded Source

Built Distribution

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

entropy_tracker-1.0.3-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file entropy_tracker-1.0.3.tar.gz.

File metadata

  • Download URL: entropy_tracker-1.0.3.tar.gz
  • Upload date:
  • Size: 48.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for entropy_tracker-1.0.3.tar.gz
Algorithm Hash digest
SHA256 4172a99cb0d919c5b3a88c07b6b1658b8b31b05652c1a4b4665baec56ea8cec5
MD5 5d5273da899788a9b67548ec0fd489af
BLAKE2b-256 5b221b6b1c1f7051762cc3617a268c0b5a7cc7dba08d410c9f8b94caa91fe63d

See more details on using hashes here.

File details

Details for the file entropy_tracker-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for entropy_tracker-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 44ea4d7527356ad54487e8f23f228f2ca844520ca70c6088719dac16802d3edd
MD5 252012e0f5637b478d757a481eedd263
BLAKE2b-256 f02bb16a3ed8376b93d6fffd1d67fdca08e9327ea9f8f737f2ae170980c90d4a

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