VIP 👤
🏠 Startseite
Vergleiche
📊 Alle Benchmarks 🦖 Dinosaurier v1 🦖 Dinosaurier v2 ✅ To-Do-Listen-Apps 🎨 Kreative freie Seiten 🎯 FSACB - Ultimatives Showcase 🌍 Übersetzungs-Benchmark
Modelle
🏆 Top 10 Modelle 🆓 Kostenlose Modelle 📋 Alle Modelle ⚙️ Kilo Code
Ressourcen
💬 Prompt-Bibliothek 📖 KI-Glossar 🔗 Nützliche Links 🔌 KI-APIs & Router
Advanced

Advanced Legacy Code Refactoring

#python #refactoring #architecture #solid

Analyze a complex, monolithic Python function with high cyclomatic complexity and refactor it into a clean, modular architecture adhering to SOLID principles.

You are an expert software architect. I will provide a legacy Python function that suffers from high cyclomatic complexity, global state usage, and lack of error handling. Your task is to: 1. Analyze the code to identify its core responsibility and side effects. 2. Break it down into smaller, single-responsibility functions or classes. 3. Apply the SOLID principles rigorously. 4. Introduce proper type hinting and docstrings. 5. Refactor the logic to improve readability and maintainability without changing the external API behavior. Return the complete refactored code and a brief explanation of the design patterns used.