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.4.tar.gz (52.8 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.4-py3-none-any.whl (57.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: entropy_tracker-1.0.4.tar.gz
  • Upload date:
  • Size: 52.8 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.4.tar.gz
Algorithm Hash digest
SHA256 62603de38e2fcfe80601f242e281aa93f67411ae8514f361a4b10a50bf1c20b6
MD5 2e249197652005f46f37c96ed069dc7d
BLAKE2b-256 857eadd8dfe5020d3ee0962d0b060aef473c882eeaa89a9a1781b0891180649f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for entropy_tracker-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a57b2d97709126e82c4a3ecb7d0c6ee3b2c7fa1b64e857e56f5cd19e29797368
MD5 eb63cfc78c578c8a11fe55cee2fa4373
BLAKE2b-256 b7101d1c3f0565a1fd52e4e2ddd65deb7bb568b8c1f924da63642c7df167c9fb

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