Skip to main content

AI Code Transparency Tool โ€” detect AI-written code, analyze commit quality, track understanding debt, sprint health, bus factor, and more

Project description

๐Ÿงฌ CodeDNA โ€” AI Code Transparency Tool

Understand every line of code you commit. Is it really yours, or AI's?

Detect which code was written by AI, measure how well developers actually understand their commits, analyze commit quality, track trends, and map out "understanding debt" across your entire team.

PyPI version License: MIT Python 3.10+ GitHub stars

Quick Start โ€ข Features โ€ข Commands โ€ข Pricing โ€ข Docs


๐ŸŽฏ The Problem

In 2026, developers write 78% of their code with AI help (Copilot, Cursor, ChatGPT, Claude). The result?

  • ๐Ÿ˜ฐ "Understanding Debt" โ€” Code is committed, but no one actually knows how it works
  • ๐ŸšŒ Bus Factor = 1 โ€” Everyone uses the same AI, no one understands the codebase
  • ๐Ÿ’ฐ Technical Debt Explosion โ€” Without human review, AI-generated code decays fast
  • ๐Ÿ› Bug Multiplication โ€” 3 months later: "Who wrote this? I don't even know what it does"

CodeDNA solves this. Every commit is scored. Every developer is measured. Every team gets visibility.


โœจ Features

๐Ÿ” AI Detection (4-metric fingerprint)

CodeDNA uses 4 heuristics to detect AI-generated code:

Metric AI Signature Score
comment_ratio > 0.3 AI over-comments its code +0.20
avg_function_length > 50 AI produces large monolithic blocks +0.15
single_commit_ratio > 0.7 Bulk-paste commits are AI-red flag +0.30
High complexity + single commit AI signature โ†’ +0.25

Total > 0.50 โ†’ AI suspected. Combined with Tree-sitter AST analysis, this gives 80%+ accuracy.

๐Ÿค– AI Score Explanation

Each file's score includes a plain-English breakdown of why it scored that way:

  • "High comment ratio (35%) โ€” AI-generated code tends to over-comment (+0.20)"
  • "High single-commit ratio (85%) โ€” bulk paste indicator (+0.30)"

๐Ÿ“ Commit Message Quality Analysis

  • Detects conventional commit types (feat:, fix:, docs:, etc.)
  • Estimates quality score (0-5) based on message clarity
  • Detects ticket references (JIRA, GitHub Issues)
  • Score bonus for scope + ticket references

๐Ÿ“Š Export & Import

  • codedna export --format json|csv โ€” export all data
  • codedna import file.json โ€” restore from export
  • API endpoints: GET /export, POST /import

๐Ÿ‘ค Developer Understanding Score

  • Survey-based โ€” Quick Q&A after each commit
  • Tracked over time โ€” See your understanding curve
  • Trend charts โ€” Dashboard /trends page

๐ŸšŒ Bus Factor Analysis

  • Ownership tracking โ€” Who owns which file?
  • Risk identification โ€” Single points of failure

๐Ÿ’ฐ Technical Debt Estimation

  • Cost in USD โ€” How much would it cost to fix this?
  • Trend over time โ€” Is debt increasing?

๐Ÿƒ Sprint Health

  • Velocity tracking โ€” Real commits vs. AI-assisted
  • Quality metrics โ€” Per-sprint scoring

๐Ÿ“ˆ Trend Charts (Dashboard)

Time-series visualization of:

  • Daily average AI probability over time
  • Understanding score trend
  • Commit frequency bar chart

๐Ÿ‘€ Live Monitoring (codedna watch)

  • Polls git repo for new commits (configurable interval)
  • Auto-runs analysis on each new commit
  • --once flag for cron-based usage
  • --notify for webhook alerts

๐Ÿ”” Webhook Notifications (Slack/Discord)

  • Configure via codedna webhook interactive wizard
  • Automatic alerts on high AI risk detection
  • Protected module violation notifications
  • Configurable risk threshold

๐Ÿ’ฌ Feedback Loop

  • Dashboard /feedback page
  • Mark AI detections as correct/incorrect/unsure
  • API endpoints for CRUD operations
  • Historical view of all feedback

๐Ÿ“‚ Multi-Repo Dashboard

  • Add/remove repositories via dashboard /repos
  • API-backed CRUD with ~/.codedna/repos.json
  • Centralized view across projects

๐Ÿค– AI Tool Comparison (Enterprise)

Copilot vs. Cursor vs. Claude โ€” which tool produces more debt?

๐ŸŽฏ Interview Tool (Enterprise)

Auto-generates questions from real code, records responses, exports reports.

๐Ÿš€ Developer Onboarding

Ramp-up curve, mentor matching, first PR analysis.

๐Ÿ›ก๏ธ Protected Modules

Mark critical files โ€” "AI may not touch auth/, payment/, security/"

๐Ÿณ Docker Self-Hosted

docker compose up
# API โ†’ http://localhost:8000
# Dashboard โ†’ http://localhost:3000

๐Ÿš€ Quick Start

Installation

pip install codedna

First Use (60 seconds)

cd your-awesome-project
codedna init       # Install git hook + create DB
codedna scan       # Analyze all files
codedna status     # Last commit score
codedna history    # Past commits

Run the Dashboard

codedna dashboard       # Web UI (port 3000) + API (port 8000)
codedna serve           # API only (port 8000)

๐Ÿ“‹ Commands (30+ total)

๐Ÿ“Š Analysis & Reporting

codedna scan                  # Full repo AI scan
codedna status                # Last commit score + commit message analysis
codedna history               # Commit history with understanding scores
codedna report                # Generate HTML report
codedna ai-compare            # AI tool comparison (Enterprise)
codedna export --format json  # Export all data (JSON/CSV)
codedna import file.json      # Restore from export

๐Ÿ‘€ Monitoring

codedna watch                 # Live repo monitoring (poll mode)
codedna watch --once          # Single analysis (cron-friendly)
codedna watch --notify        # With webhook alerts
codedna webhook --show        # Show webhook config
codedna webhook --test        # Send test notification
codedna webhook --reset       # Clear webhook config

๐Ÿ›ก๏ธ Protection & Policies

codedna protect add <path>    # Add protected module
codedna protect remove <path> # Remove protection
codedna protect list          # List protected modules
codedna protect check         # Show violations

๐Ÿ‘ฅ Team & Process

codedna onboarding            # Developer ramp-up (Team+)
codedna interview start       # Start interview (Enterprise)
codedna interview list        # List interviews
codedna interview score       # Score interview
codedna bus-factor            # Ownership analysis (Team+)
codedna debt                  # Technical debt (Team+)
codedna sprint create         # Create sprint
codedna sprint health         # Latest sprint score
codedna sprint history        # All sprints

๐ŸŒ Infrastructure

codedna serve                 # FastAPI REST (port 8000)
codedna dashboard             # Web dashboard (port 3000)
codedna pr-comment            # GitHub PR comment
codedna plan                  # Plan/license management
codedna setup                 # AI analysis config wizard
codedna security-check        # Pre-publish secret scanner
codedna doctor                # System health check
codedna update                # Self-upgrade from PyPI
codedna uninstall             # Remove git hook

๐Ÿ’Ž Pricing

Plan Price Repos History Dashboard Key Features
Free $0 1 7 days โŒ AI detection, local only
Pro $12/mo โˆž 90 days โœ… + Export, Webhooks, Watch
Team $24/mo โˆž 365 days โœ… + Bus Factor, Sprint, Onboarding
Enterprise $49/mo โˆž โˆž โœ… + AI Compare, Interview Tool, SSO

๐Ÿ”Œ Integrations

  • GitHub Actions โ€” Auto-comment on PR
  • Jira โ€” Sprint health webhook
  • Slack โ€” AI risk notifications
  • Discord โ€” Webhook alerts
  • GitHub Copilot / Cursor / Claude โ€” AI tool detection
  • Docker โ€” Self-hosted deployment

๐Ÿ› ๏ธ Architecture

CLI (Python, Typer, Tree-sitter, GitPython, SQLite)
  โ”‚
  โ”œโ”€โ”€ codedna scan / status / history
  โ”œโ”€โ”€ codedna export / import
  โ”œโ”€โ”€ codedna watch / webhook
  โ”œโ”€โ”€ codedna protect / bus-factor / debt
  โ”œโ”€โ”€ codedna sprint / onboarding
  โ”œโ”€โ”€ codedna serve / dashboard
  โ””โ”€โ”€ codedna doctor / update / security-check
        โ”‚
        โ†“ HTTP
REST API (FastAPI, JWT Auth, Rate Limiting)
  โ”œโ”€โ”€ /health, /repo/*
  โ”œโ”€โ”€ /commits, /files, /report
  โ”œโ”€โ”€ /survey, /sprints, /bus-factor, /debt
  โ”œโ”€โ”€ /trends, /trends/commits
  โ”œโ”€โ”€ /feedback (POST + GET)
  โ”œโ”€โ”€ /repos (GET + POST + DELETE)
  โ”œโ”€โ”€ /export, /import
  โ”œโ”€โ”€ /auth (register, login, me)
  โ””โ”€โ”€ /billing (checkout, webhook, subscription)
        โ”‚
        โ†“ HTTP
Web Dashboard (Next.js 14, TypeScript, Tailwind)
  โ”œโ”€โ”€ / (overview + metrics)
  โ”œโ”€โ”€ /files, /commits, /report
  โ”œโ”€โ”€ /bus-factor, /debt, /sprints
  โ”œโ”€โ”€ /trends (charts)
  โ”œโ”€โ”€ /feedback (AI accuracy feedback)
  โ”œโ”€โ”€ /repos (multi-repo management)
  โ”œโ”€โ”€ /ai-compare, /onboarding
  โ”œโ”€โ”€ /protected, /interview
  โ”œโ”€โ”€ /pricing, /billing
  โ””โ”€โ”€ /login, /register

Self-Hosted (Docker)

git clone https://github.com/natureco-official/codedna.git
cd codedna
docker compose up

๐Ÿ—๏ธ Tech Stack

  • Python 3.10+ with Typer, FastAPI, Tree-sitter, GitPython, SQLite
  • Next.js 14 with TypeScript, Tailwind CSS
  • Docker โ€” API + Dashboard containers
  • Lemon Squeezy โ€” Billing
  • uv โ€” Python packaging

๐Ÿ”’ Security

  • HMAC-SHA256 webhook verification
  • bcrypt password hashing (cost 12)
  • JWT tokens (7-day expiry)
  • httpOnly + secure + sameSite cookies
  • Parameterized SQL queries
  • Pydantic input validation
  • Rate limiting
  • No telemetry โ€” your code stays yours

๐ŸŒ Supported Languages

Python (.py), JavaScript (.js), TypeScript (.ts), JSX (.jsx), TSX (.tsx)


๐Ÿงช Testing

pytest                    # 23+ tests
pytest --cov=codedna      # With coverage

๐Ÿ“š Documentation


๐Ÿ“œ License

MIT License โ€” Copyright (c) 2026 NatureCo


Made with ๐ŸŒฟ in Turkey

โญ Star us on GitHub โ€ข ๐Ÿ“ฆ Install from PyPI

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

codedna-0.9.1.tar.gz (297.7 kB view details)

Uploaded Source

Built Distribution

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

codedna-0.9.1-py3-none-any.whl (340.0 kB view details)

Uploaded Python 3

File details

Details for the file codedna-0.9.1.tar.gz.

File metadata

  • Download URL: codedna-0.9.1.tar.gz
  • Upload date:
  • Size: 297.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codedna-0.9.1.tar.gz
Algorithm Hash digest
SHA256 17748e7d0be5930bf8db6090e1091540d9f48e17af27cb37008457dea3b06743
MD5 fbe173087dbc66ca4633b9674c0dafb0
BLAKE2b-256 0a14247b5987ddf98286680320c5f1836666720ecb384aa1aa87d3aaab0858a1

See more details on using hashes here.

File details

Details for the file codedna-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: codedna-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 340.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codedna-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d8778c320634074947f0c70ed2ad4462126bfeaf149fa640b3e7f0fd0eed866
MD5 404499240eb278dfb38d777cf8b852d9
BLAKE2b-256 cdd9356c41bbb578cba7233263b637c9bab50b797f834fd2ba620de86632e4c4

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