codedna-analyzer 1.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. codedna/__init__.py +3 -0
  2. codedna/analyzers/__init__.py +1 -0
  3. codedna/analyzers/ai_analyzer.py +111 -0
  4. codedna/analyzers/architecture_detector.py +150 -0
  5. codedna/analyzers/cache_manager.py +70 -0
  6. codedna/analyzers/code_smell_detector.py +302 -0
  7. codedna/analyzers/complexity_analyzer.py +329 -0
  8. codedna/analyzers/dependency_mapper.py +171 -0
  9. codedna/analyzers/developer_analyzer.py +148 -0
  10. codedna/analyzers/diff_engine.py +395 -0
  11. codedna/analyzers/dna_generator.py +308 -0
  12. codedna/analyzers/evolution_engine.py +193 -0
  13. codedna/analyzers/github_analyzer.py +86 -0
  14. codedna/analyzers/language_detector.py +151 -0
  15. codedna/analyzers/repo_cloner.py +91 -0
  16. codedna/analyzers/security_detector.py +271 -0
  17. codedna/analyzers/structure_analyzer.py +91 -0
  18. codedna/ci/__init__.py +5 -0
  19. codedna/ci/gatekeeper.py +421 -0
  20. codedna/cli.py +839 -0
  21. codedna/compliance/__init__.py +5 -0
  22. codedna/compliance/sbom.py +410 -0
  23. codedna/config.py +167 -0
  24. codedna/mcp/__init__.py +5 -0
  25. codedna/mcp/protocol.py +65 -0
  26. codedna/mcp/server.py +393 -0
  27. codedna/remediation/__init__.py +5 -0
  28. codedna/remediation/planner.py +244 -0
  29. codedna/visualization/__init__.py +1 -0
  30. codedna/visualization/html_export.py +507 -0
  31. codedna/visualization/renderer.py +373 -0
  32. codedna_analyzer-1.4.0.dist-info/METADATA +425 -0
  33. codedna_analyzer-1.4.0.dist-info/RECORD +37 -0
  34. codedna_analyzer-1.4.0.dist-info/WHEEL +5 -0
  35. codedna_analyzer-1.4.0.dist-info/entry_points.txt +2 -0
  36. codedna_analyzer-1.4.0.dist-info/licenses/LICENSE +21 -0
  37. codedna_analyzer-1.4.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,425 @@
1
+ Metadata-Version: 2.4
2
+ Name: codedna-analyzer
3
+ Version: 1.4.0
4
+ Summary: 🧬 A genetic analyzer for software — reverse-engineer any codebase into a DNA profile.
5
+ Author-email: Shenal Diluksha <shenald@users.noreply.github.com>
6
+ Maintainer-email: shenald-dev <shenald@users.noreply.github.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/shenald-dev/codedna
9
+ Project-URL: Documentation, https://github.com/shenald-dev/codedna#readme
10
+ Project-URL: Repository, https://github.com/shenald-dev/codedna
11
+ Project-URL: Issues, https://github.com/shenald-dev/codedna/issues
12
+ Project-URL: Changelog, https://github.com/shenald-dev/codedna/blob/main/CHANGELOG.md
13
+ Keywords: code-analysis,architecture,dependency-graph,software-intelligence,dna,cli
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.11
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: click>=8.0.0
27
+ Requires-Dist: rich>=13.0.0
28
+ Requires-Dist: GitPython>=3.1.0
29
+ Requires-Dist: networkx>=3.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
32
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
33
+ Requires-Dist: pytest-subtests; extra == "dev"
34
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
35
+ Provides-Extra: ai
36
+ Requires-Dist: openai>=1.0.0; extra == "ai"
37
+ Dynamic: license-file
38
+
39
+ <div align="center">
40
+ <img src="assets/logo.png" alt="CodeDNA Logo" width="250" />
41
+
42
+ <br/>
43
+
44
+ <h1>🧬 CodeDNA</h1>
45
+ <p><b>Software Intelligence System — A Genetic Analyzer for Code</b></p>
46
+ <i>Reverse-engineer any codebase into a DNA profile. Track genetic drift across releases, enforce architectural quality gates in CI/CD, and visualize system evolution.</i>
47
+
48
+ <br/>
49
+
50
+ [![PyPI version](https://img.shields.io/pypi/v/codedna-analyzer.svg)](https://pypi.org/project/codedna-analyzer/)
51
+ [![CI](https://github.com/shenald-dev/codedna/actions/workflows/ci.yml/badge.svg)](https://github.com/shenald-dev/codedna/actions)
52
+ [![Python 3.11+](https://img.shields.io/badge/Python-3.11%2B-blue.svg)](https://python.org)
53
+ [![Version](https://img.shields.io/badge/Release-v1.4.0-cyan.svg)](https://github.com/shenald-dev/codedna/releases)
54
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
55
+ </div>
56
+
57
+ ---
58
+
59
+ ## 📑 Table of Contents
60
+ - [✨ What is CodeDNA?](#-what-is-codedna)
61
+ - [🚀 Flagship Capabilities](#-flagship-capabilities)
62
+ - [1. ⚙️ Declarative Configuration (`codedna.toml`)](#1-️-declarative-configuration-codednatoml)
63
+ - [2. 🛡️ Architectural Drift Regression Gating (`gate`)](#2-️-architectural-drift-regression-gating-gate)
64
+ - [3. 🧬 Genetic Drift & Architecture Diff Engine (`diff`)](#3--genetic-drift--architecture-diff-engine-diff)
65
+ - [4. 🛡️ CI/CD Quality Gatekeeper & SARIF / PR Markdown (`check`)](#4-️-cicd-quality-gatekeeper--sarif--pr-markdown-check)
66
+ - [5. 🔒 Enterprise Security & Shannon Entropy Scanner](#5--enterprise-security--shannon-entropy-scanner)
67
+ - [6. 🎯 Interactive Executive Radar & HTML Dashboard](#6--interactive-executive-radar--html-dashboard)
68
+ - [7. 🔌 Model Context Protocol Gateway (`mcp`)](#7--model-context-protocol-gateway-mcp)
69
+ - [8. ⚙️ Cyclomatic & Cognitive Complexity Engine (`complexity`)](#8-️-cyclomatic--cognitive-complexity-engine-complexity)
70
+ - [9. 🔒 Executive Compliance Audit (`audit`)](#9--executive-compliance-audit-audit)
71
+ - [10. 📦 Software Bill of Materials Engine (`sbom`)](#10--software-bill-of-materials-engine-sbom)
72
+ - [11. 🔧 Intelligent Auto-Remediation Engine (`fix` / `remediate`)](#11--intelligent-auto-remediation-engine-fix--remediate)
73
+ - [🏗️ Analysis Pipeline](#️-analysis-pipeline)
74
+ - [🛠️ Quick Start Guide](#️-quick-start-guide)
75
+ - [💻 Comprehensive Usage](#-comprehensive-usage)
76
+ - [Project Scaffolding (`init`)](#project-scaffolding-init)
77
+ - [Analyze a Codebase](#analyze-a-codebase)
78
+ - [Compare Codebases / Branches (`diff`)](#compare-codebases--branches-diff)
79
+ - [Gating Architectural Drift in CI (`gate`)](#gating-architectural-drift-in-ci-gate)
80
+ - [Enforce Quality Gates in CI (`check`)](#enforce-quality-gates-in-ci-check)
81
+ - [GitHub Actions Integration Examples](#github-actions-integration-examples)
82
+ - [🧬 Example Output](#-example-output)
83
+ - [🤝 Contributing](#-contributing)
84
+
85
+ ---
86
+
87
+ ## ✨ What is CodeDNA?
88
+
89
+ **CodeDNA** reverse-engineers any codebase and generates a comprehensive "DNA profile". It acts as an automated software architect, traversing tens of thousands of lines of code to distill exactly what a system does, how it is structured, where technical debt hides, and how it is mutating over time.
90
+
91
+ | Dimension | What It Reveals |
92
+ | :--- | :--- |
93
+ | 🏗️ **Architecture Pattern** | Monolith, MVC, Layered, Microservices, Plugin, Event-Driven |
94
+ | 📊 **Language Distribution** | Files, lines, and percentage share per language (50+ languages supported) |
95
+ | 🔗 **Dependency Graph** | Module topology, coupling density, circular dependency cycle detection |
96
+ | 🐛 **Code Smells & Hygiene** | God classes, runaway file length, bloated functions, Spaghetti Hub coupling |
97
+ | 🔒 **Security Posture** | Hardcoded secrets, AI API keys (OpenAI, Anthropic, HF), command & SQL injection |
98
+ | 👥 **Developer Genome** | Active contributors, bus factor risk, primary architects, collaboration |
99
+ | 📈 **Evolution Timeline** | Commit growth velocity, churn hotspots, architecture shifts |
100
+ | 🧬 **Genetic Drift** | Similarity scoring and mutation delta between branches, commits, or forks |
101
+
102
+ ---
103
+
104
+ ## 🚀 Flagship Capabilities
105
+
106
+ ### 1. ⚙️ Declarative Configuration (`codedna.toml`)
107
+ Configure CodeDNA directly within your repository using `codedna.toml` or `pyproject.toml [tool.codedna]`:
108
+ - **Path Exclusion Globs:** Cleanly ignore test suites, build outputs, and minified bundles across all analyzers.
109
+ - **Secret Whitelisting:** Suppress false positives for intentional test fixtures or mock keys.
110
+ - **Custom Smell Thresholds:** Tailor file length, function lines, and method count thresholds to your project's standards.
111
+ - **Gate Policies:** Specify default CI quality constraints without repeating CLI flags.
112
+
113
+ ```toml
114
+ # codedna.toml
115
+ ignore_paths = ["tests/*", "docs/*", "build/*"]
116
+ whitelisted_secrets = ["PUBLIC_KEY", "MOCK_TOKEN"]
117
+
118
+ [gate]
119
+ min_health = "Fair"
120
+ max_critical_smells = 0
121
+ fail_on_secrets = true
122
+ fail_on_circular = false
123
+ max_drift = 20.0
124
+
125
+ [smells]
126
+ max_file_lines = 650
127
+ max_function_lines = 120
128
+ god_class_methods = 20
129
+ ```
130
+
131
+ ### 2. 🛡️ Architectural Drift Regression Gating (`gate`)
132
+ Block pull requests that introduce architectural regressions or degrade code quality:
133
+ - **Baseline vs. Target:** Compare incoming PR branches against `origin/main` or pre-computed baseline JSON profiles.
134
+ - **Zero-Regression Policies:** Fails immediately if codebase health degrades (e.g., Healthy ➔ Critical), circular dependencies are introduced, or genetic drift exceeds allowable tolerance.
135
+ - **Exit Codes:** Exits with `0` on clean gates, `1` on regression breach.
136
+
137
+ ```bash
138
+ # Evaluate drift between main branch and current working tree
139
+ codedna gate origin/main .
140
+
141
+ # Evaluate drift between two DNA profiles with custom similarity requirements
142
+ codedna gate baseline_profile.json pr_profile.json --min-similarity 85.0
143
+ ```
144
+
145
+ ### 3. 🧬 Genetic Drift & Architecture Diff Engine (`diff`)
146
+ Compare two repositories, branches, or pre-generated DNA profiles to measure **architectural drift** and **genetic similarity** (0.0% to 100.0%):
147
+ - **Similarity Scoring:** Multi-vector composite evaluation across language distributions, structural size, architectural patterns, dependency graph density, and health ratings.
148
+ - **Structural Deltas:** Track added/removed modules, file volume shifts, and language composition changes.
149
+ - **Coupling & Cycle Shifts:** Instant alerts if circular dependencies were introduced or resolved.
150
+ - **Inline Gating:** Pass `--fail-on-drift` to turn `diff` into a regression gatekeeper.
151
+
152
+ ```bash
153
+ # Compare two local repositories
154
+ codedna diff ./repo-main ./repo-refactor
155
+
156
+ # Compare two saved DNA profile snapshots with inline drift gating
157
+ codedna diff reports/profile_v1.json reports/profile_v2.json --fail-on-drift
158
+ ```
159
+
160
+ ### 4. 🛡️ CI/CD Quality Gatekeeper & SARIF / PR Markdown (`check`)
161
+ Enforce architectural rules and security standards directly in your build and PR validation pipelines:
162
+ - **Policy Gates:** Reject PRs that breach health ratings, introduce hardcoded secrets, or exceed smell thresholds.
163
+ - **Native SARIF v2.1.0:** Generates OASIS SARIF output for GitHub Code Scanning tab annotations.
164
+ - **PR Review Markdown:** Generates formatted markdown tables (`--format markdown`) ready to post as PR review comments.
165
+
166
+ ```bash
167
+ # Validate local repo in CI
168
+ codedna check .
169
+
170
+ # Generate Markdown table for GitHub Actions PR comment
171
+ codedna check . --format markdown --output pr-comment.md
172
+
173
+ # Export SARIF for GitHub Code Scanning
174
+ codedna check . --format sarif --output codedna-results.sarif
175
+ ```
176
+
177
+ ### 5. 🔒 Enterprise Security & Shannon Entropy Scanner
178
+ Built-in zero-dependency scanning for high-risk vulnerabilities, high-entropy secrets, and cloud credentials:
179
+ - **Shannon Entropy Secret Hunter:** Computes mathematical information density ($H(S) = -\sum p(c) \log_2 p(c)$) to surface unformatted API keys, hex secrets, and base64 private tokens without relying on brittle prefix guessing.
180
+ - **AI & Cloud API Tokens:** Detects exposed keys for OpenAI (`sk-...`), Anthropic (`sk-ant-...`), Google Gemini (`AIzaSy...`), Cohere, Mistral, Perplexity, DeepSeek, Groq, Hugging Face (`hf_...`), Pinecone (`pcsk_...`), AWS, GitHub, Stripe, and Slack.
181
+ - **Database Connection URIs:** Flags embedded passwords in database strings (`postgres://`, `mysql://`, `mongodb://`, `redis://`).
182
+ - **Insecure Deserialization & Injection:** Catches dangerous `pickle.loads()`, `yaml.unsafe_load()`, `subprocess.*(shell=True)`, and SQL f-strings.
183
+
184
+ ### 6. 🎯 Interactive Executive Radar & HTML Dashboard
185
+ The generated HTML dashboard includes:
186
+ - **Pure SVG Radar Chart:** Five-dimensional assessment (Health & Hygiene, Security Posture, Modularity & Coupling, Architecture Cohesion, Team Resilience) rendered with zero external CDN dependencies.
187
+ - **Interactive Risk Filter:** Client-side instant filtering across code smells, god classes, and security warnings.
188
+ - **Print / PDF Ready:** Fully styled `@media print` support for executive architecture reviews.
189
+
190
+ ### 7. 🔌 Model Context Protocol Gateway (`mcp`)
191
+ Expose CodeDNA as an official **MCP (2024-11-05 Specification)** JSON-RPC 2.0 server over stdio for AI coding assistants:
192
+ - Seamlessly integrates with **Claude Desktop**, **Cursor**, **Windsurf**, and **Antigravity**.
193
+ - Provides 7 standard tools: `codedna_analyze`, `codedna_inspect_architecture`, `codedna_security_audit`, `codedna_complexity_metrics`, `codedna_dependency_graph`, `codedna_quality_gate`, and `codedna_drift_diff`.
194
+
195
+ ```json
196
+ // claude_desktop_config.json
197
+ {
198
+ "mcpServers": {
199
+ "codedna": {
200
+ "command": "codedna",
201
+ "args": ["mcp"]
202
+ }
203
+ }
204
+ }
205
+ ```
206
+
207
+ ### 8. ⚙️ Cyclomatic & Cognitive Complexity Engine (`complexity`)
208
+ Comprehensive function-level structural analysis using Python AST and universal token streaming:
209
+ - **McCabe Cyclomatic Complexity ($CC$):** Exact decision point counting (`if`, `while`, `for`, `except`, `assert`, boolean chains, comprehensions).
210
+ - **Cognitive Complexity:** Standard Sonarsource nesting-penalized evaluation.
211
+ - **Maintainability Index ($MI$):** Standard SEI maintainability scoring on a 0–100 scale with letter grade rankings (A through F).
212
+
213
+ ### 9. 🛡️ Executive Compliance Audit (`audit`)
214
+ Fast, terminal-native security and architectural compliance audit with colorized Rich tables and strict exit codes (`0` for pass, `1` for policy breach).
215
+
216
+ ### 10. 📦 Software Bill of Materials Engine (`sbom`)
217
+ Generate industry-standard, audit-ready SBOM manifests conforming to federal and enterprise compliance mandates:
218
+ - **CycloneDX (v1.5 JSON):** Complete component graphs, Package URLs (`purl`), and dependency relationships.
219
+ - **SPDX (v2.3 JSON):** Open source package catalogs, licensing assertions, and document hashes.
220
+ - **Multi-Ecosystem Discovery:** Parses Python (`pyproject.toml`, `requirements.txt`), Node.js (`package.json`, `package-lock.json`), Rust (`Cargo.toml`, `Cargo.lock`), and Go (`go.mod`).
221
+ ```bash
222
+ # Generate CycloneDX SBOM
223
+ codedna sbom . --format cyclonedx --output sbom-cyclonedx.json
224
+
225
+ # Generate SPDX SBOM
226
+ codedna sbom . --format spdx --output sbom-spdx.json
227
+ ```
228
+
229
+ ### 11. 🔧 Intelligent Auto-Remediation Engine (`fix` / `remediate`)
230
+ Close the loop from diagnostic detection to resolution with deterministic code patches:
231
+ - **Bare Exceptions:** Safely transforms broad `except:` to typed `except Exception:` handlers.
232
+ - **Secret Extraction:** Refactors hardcoded API keys and tokens into `os.getenv(...)` variables.
233
+ - **Wildcard Resolution:** Pins open-ended `package.json` `"*"` wildcards to safe semantic ranges (`^1.0.0`).
234
+ - **Unified Diffs & Dry-Runs:** Preview patches before application or export unified patch files.
235
+ ```bash
236
+ # Preview auto-remediation plan
237
+ codedna remediate . --dry-run
238
+
239
+ # Automatically patch safe findings on disk
240
+ codedna fix .
241
+ ```
242
+
243
+ ---
244
+
245
+ ## 🏗️ Analysis Pipeline
246
+
247
+ CodeDNA executes a modular 10-stage analysis pipeline:
248
+
249
+ ```mermaid
250
+ graph TD
251
+ A[Repository / Git Input] --> B[Repo Cloner / Path Resolver]
252
+ B --> C[Language Detector]
253
+ C --> D[Structure Analyzer]
254
+ D --> E[Dependency Mapper & Mermaid Graph]
255
+ E --> F[Architecture Pattern Detector]
256
+ F --> G[Code Smell & Hygiene Detector]
257
+ G --> H[Security & Secret Scanner]
258
+ H --> I[Developer & Bus Factor Analyzer]
259
+ I --> J[Evolution & Git Churn Engine]
260
+ J --> K[DNA Profile Synthesis]
261
+ K --> L[Terminal Visualizer]
262
+ K --> M[HTML Executive Dashboard]
263
+ K --> N[CI Gatekeeper & SARIF]
264
+ K --> O[Genetic Diff Engine]
265
+ ```
266
+
267
+ ---
268
+
269
+ ## 🛠️ Quick Start Guide
270
+
271
+ ### Installation
272
+ ```bash
273
+ pip install codedna-analyzer
274
+ ```
275
+
276
+ Or install via `pipx` or `uv`:
277
+ ```bash
278
+ pipx install codedna-analyzer
279
+ # or
280
+ uv tool install codedna-analyzer
281
+ ```
282
+
283
+ Verify installation:
284
+ ```bash
285
+ codedna --version
286
+ # codedna, version 1.4.0
287
+ ```
288
+
289
+ ---
290
+
291
+ ## 💻 Comprehensive Usage
292
+
293
+ ### Project Scaffolding (`init`)
294
+ Scaffold a starter configuration file in your project:
295
+ ```bash
296
+ codedna init .
297
+ ```
298
+
299
+ ### Analyze a Codebase
300
+ ```bash
301
+ # Analyze a public GitHub repository
302
+ codedna analyze https://github.com/user/project
303
+
304
+ # Analyze local directory and save all reports (HTML, JSON, Markdown)
305
+ codedna analyze . --output reports/
306
+
307
+ # Headless mode for automated environments
308
+ codedna analyze . --no-visualize --output reports/ --format json
309
+ ```
310
+
311
+ ### Compare Codebases / Branches (`diff`)
312
+ ```bash
313
+ # Terminal comparison
314
+ codedna diff ./release-1.0 ./release-2.0
315
+
316
+ # Generate Markdown diff report
317
+ codedna diff ./branch-a ./branch-b --format markdown --output diff-report.md
318
+ ```
319
+
320
+ ### Gating Architectural Drift in CI (`gate`)
321
+ ```bash
322
+ # Block PR if architecture degrades compared to baseline
323
+ codedna gate baseline_dna.json current_dna.json
324
+
325
+ # Fail if similarity drops below 90% or circular dependencies are added
326
+ codedna gate ./main-repo ./pr-repo --min-similarity 90.0
327
+ ```
328
+
329
+ ### Enforce Quality Gates in CI (`check`)
330
+ ```bash
331
+ # Standard CI check
332
+ codedna check .
333
+
334
+ # Fail on circular dependencies or critical smells
335
+ codedna check . --fail-on-circular --max-critical-smells 0
336
+ ```
337
+
338
+ ### GitHub Actions Integration Examples
339
+
340
+ #### 1. GitHub Code Scanning (SARIF)
341
+ ```yaml
342
+ name: Architecture & Security Gate
343
+ on: [pull_request]
344
+
345
+ jobs:
346
+ codedna-gate:
347
+ runs-on: ubuntu-latest
348
+ steps:
349
+ - uses: actions/checkout@v4
350
+ with:
351
+ fetch-depth: 100
352
+
353
+ - name: Set up Python
354
+ uses: actions/setup-python@v5
355
+ with:
356
+ python-version: '3.11'
357
+
358
+ - name: Install CodeDNA
359
+ run: pip install codedna
360
+
361
+ - name: Run CodeDNA Gatekeeper & SARIF Export
362
+ run: codedna check . --format sarif --output codedna.sarif
363
+
364
+ - name: Upload SARIF to GitHub Code Scanning
365
+ if: always()
366
+ uses: github/codeql-action/upload-sarif@v3
367
+ with:
368
+ sarif_file: codedna.sarif
369
+ ```
370
+
371
+ #### 2. Automated PR Review Comment
372
+ ```yaml
373
+ - name: Generate PR Quality Table
374
+ run: codedna check . --format markdown --output pr-summary.md
375
+
376
+ - name: Comment PR
377
+ uses: actions/github-script@v7
378
+ with:
379
+ script: |
380
+ const fs = require('fs');
381
+ const body = fs.readFileSync('pr-summary.md', 'utf8');
382
+ github.rest.issues.createComment({
383
+ issue_number: context.issue.number,
384
+ owner: context.repo.owner,
385
+ repo: context.repo.repo,
386
+ body: body
387
+ });
388
+ ```
389
+
390
+ ---
391
+
392
+ ## 🧬 Example Output
393
+
394
+ ### Genetic Drift & Mutation Diff
395
+ ```
396
+ ┌─────────────────────────── 🧬 Architecture Diff ────────────────────────────┐
397
+ │ │
398
+ │ 🧬 CodeDNA Genetic Drift & Mutation Diff │
399
+ │ Baseline (A): ./v1.1.0 │
400
+ │ Target (B): ./v1.2.0 │
401
+ │ │
402
+ │ Genetic Similarity: 96.5% ███████████████████░ │
403
+ │ Mutation Verdict: Quality & Hygiene Improvement │
404
+ └─────────────────────────────────────────────────────────────────────────────┘
405
+
406
+ 📊 Architectural & Structural Drift
407
+ ┌──────────────────┬──────────────┬──────────────┬────────────────────────────┐
408
+ │ Dimension │ Baseline (A) │ Target (B) │ Drift / Delta │
409
+ ├──────────────────┼──────────────┼──────────────┼────────────────────────────┤
410
+ │ Architecture │ Monolith │ Monolith │ Unchanged │
411
+ │ Health Score │ Fair │ Healthy │ Improved (crit: 0, warn: 0)│
412
+ │ Files Count │ - │ - │ +6 files │
413
+ │ Circular Deps │ None ✅ │ None ✅ │ Clean │
414
+ │ Bus Factor │ - │ - │ +1 │
415
+ └──────────────────┴──────────────┴──────────────┴────────────────────────────┘
416
+ ```
417
+
418
+ ---
419
+
420
+ ## 🤝 Contributing
421
+ - 🐛 **Bug reports & ideas:** Open an issue on GitHub.
422
+ - 🚀 **Feature additions:** PRs welcome! Ensure all tests pass with `pytest` and code matches `ruff check`.
423
+
424
+ ---
425
+ > *Software has DNA too. Decode it with CodeDNA.*
@@ -0,0 +1,37 @@
1
+ codedna/__init__.py,sha256=peQhyGJmAlh6MydQQAFqokNfLXMznjMvtuXBPdJtezA,77
2
+ codedna/cli.py,sha256=QAsiZ_we9A86TNu0QgFjRZuhZr8D-v_kRGGOVWbDkx8,36691
3
+ codedna/config.py,sha256=Zux46faLhGl9YHM-d26XTKFHfGMeJGPq1lqRWBqMs5Q,6478
4
+ codedna/analyzers/__init__.py,sha256=MJhn6S5pT95_oj37dvpjKxEa5g5aEl7cEHN83scKlB8,52
5
+ codedna/analyzers/ai_analyzer.py,sha256=zQMhRz6x9ctBgpvWEwBhBEviTEGQtnvNwS-mCdvdwBM,4507
6
+ codedna/analyzers/architecture_detector.py,sha256=Fb8-dG-D4T5D8I9A5U2V7CRms47w5cHy_KGk9nA2Pik,5515
7
+ codedna/analyzers/cache_manager.py,sha256=L8xUtmi8f17jDzCLfg6HSVD0VPizw94-VJ7PWvQf4T0,2445
8
+ codedna/analyzers/code_smell_detector.py,sha256=ZwFbupHjZfp3fXfrd6yn7T-OkEHfgh7JrBxdmFFU2H0,12669
9
+ codedna/analyzers/complexity_analyzer.py,sha256=tW7KcCKwWtK7x7PGJmZqFBLLFaGPy4j-oMnHHkaW6iw,12991
10
+ codedna/analyzers/dependency_mapper.py,sha256=yBbOt34YpiROAusr3pxclTGaIhBz14FmrWlbXg7ycm0,6149
11
+ codedna/analyzers/developer_analyzer.py,sha256=F0-wMDPKH-SrY0p_EXGrByFKSs2pozhvJCdo9Lau8kE,5697
12
+ codedna/analyzers/diff_engine.py,sha256=JtrFn7r_85M6fnjT0NUYvduFU-I4Y3LVn6pItPPB1MY,17406
13
+ codedna/analyzers/dna_generator.py,sha256=at3lxDJfrsswJ8in36gLdIFn7uCV67CXJreGreY_3ZE,12453
14
+ codedna/analyzers/evolution_engine.py,sha256=SjBOK2jrySYOuI_1Nvl6x9mrB0KFMtaDFzNQINHgto0,6827
15
+ codedna/analyzers/github_analyzer.py,sha256=71-081yqetTvhGWV_hw582uck8EfW_CX5GSvdDjQlVk,2944
16
+ codedna/analyzers/language_detector.py,sha256=ogGjCe7w0vQAZUkRg46PvOJ7wj2eR9yKmXsuCVBrB-w,4324
17
+ codedna/analyzers/repo_cloner.py,sha256=iNEqFhDIJyl0ziLX_RhHxdUyQVGlmdmTE7Idw8WvQJw,3312
18
+ codedna/analyzers/security_detector.py,sha256=pijqFMDaqC8N1nLEabW6-u0tAOvF0uKGkZSOoVyF4z8,13232
19
+ codedna/analyzers/structure_analyzer.py,sha256=ej038Emwn4AvMJaXdPiziWEUCJUyoN3eeoHiGY1DTBM,3354
20
+ codedna/ci/__init__.py,sha256=WTtiae4lSLEZ1ybBjJD1mh6CcVV-IqhJn-J7uCh300I,168
21
+ codedna/ci/gatekeeper.py,sha256=--MokU3_BtFBaCz2myYgiCFNGOBixjvLy8cfdoDkIu4,17739
22
+ codedna/compliance/__init__.py,sha256=SRf6uIP7-Lhj7yZ--0sDouQAmruwabrRcvjbHKbFC_4,128
23
+ codedna/compliance/sbom.py,sha256=qHwxcJ0oqnXFdt3J_gRl-umUG6Fom53G4iQ1PGdCb2I,17249
24
+ codedna/mcp/__init__.py,sha256=UdpV22YGzJFA8eXOLCR6E47BVU3EbDC09GwYKhJ_JMk,133
25
+ codedna/mcp/protocol.py,sha256=dZXG9esDPQuPDP1Ugny0_0UVc9_b3xMRY7-FH9Qvd6E,1717
26
+ codedna/mcp/server.py,sha256=KyJwd8TVlBzmBx_l8yi8TuVEcEHv2lL2upiUuSvAEek,17634
27
+ codedna/remediation/__init__.py,sha256=ZIzNS9YxjeEl1A5Ry910lFYR34RYSO9K-Ijmat4KS30,169
28
+ codedna/remediation/planner.py,sha256=kq0XdKH-QkNK1wCjGts0WZ7D9PApvwv4-SGXSdbFOQE,10871
29
+ codedna/visualization/__init__.py,sha256=vL0sHbUzX09NxS1J6dZxAUl1QpylZGeLbhX7kzOimes,52
30
+ codedna/visualization/html_export.py,sha256=pwRUrcqXrESHOzF2GauhBp-khFl00iXZj2m-XPIjQIY,23644
31
+ codedna/visualization/renderer.py,sha256=MAMaPy4X3FkpGEL8fx1oW3vkW1_5reSveMstMdbTCc8,16000
32
+ codedna_analyzer-1.4.0.dist-info/licenses/LICENSE,sha256=S6mLu9vpRpkEYeoHLB7vV8Vh_LWbyvaUbV58jPLjegM,1089
33
+ codedna_analyzer-1.4.0.dist-info/METADATA,sha256=0mw4PKTzhDpin4ft_DKaAtmA_ioegUucgmox42bxDxw,20182
34
+ codedna_analyzer-1.4.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
35
+ codedna_analyzer-1.4.0.dist-info/entry_points.txt,sha256=0pXR9iZgAwjwYbEGO3MSrlmYcrhMw6QXntKqq5KjWgM,45
36
+ codedna_analyzer-1.4.0.dist-info/top_level.txt,sha256=wzZTDB1uGf1sGCW593e8tQNmwhqZ4HoyXSlowMhbGd8,8
37
+ codedna_analyzer-1.4.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ codedna = codedna.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shenald-dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ codedna