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. Code analysis runs entirely locally. Dependency checks query PyPI to detect version drift - no data about your code is sent anywhere.


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.


Live Demo

entropy.kwixlab.com - pre-loaded scans of Django, FastAPI, and boto. No login required.


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.1.tar.gz (46.4 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.1-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: entropy_tracker-1.0.1.tar.gz
  • Upload date:
  • Size: 46.4 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.1.tar.gz
Algorithm Hash digest
SHA256 38bd3ebd6d440b6d11ad31b66840cd8df202586d728ff86239ebb16786b3d559
MD5 869a8268bdebae9f11b5ba214669be4f
BLAKE2b-256 885923d54773e0529eebf6d1acab3e1f4bf40029a198b337818cca1bf83ae30d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for entropy_tracker-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ee15f11f9a16282cab26a72a3b89248927892991e9b356b7b507dd54a5e3d3c
MD5 41e732b80a510f20c307968344051e25
BLAKE2b-256 7252c276f3df41fa59da20a6bf48f9e1b81e69d4e989c6880eb3b32744187808

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