VIP 👤
🏠 Home
Prestatietests
📊 Alle benchmarks 🦖 Dinosaur v1 🦖 Dinosaur v2 ✅ To-Do List applicaties 🎨 Creatieve vrije pagina's 🎯 FSACB - Ultieme showcase 🌍 Vertaalbenchmark
Modellen
🏆 Top 10 modellen 🆓 Gratis modellen 📋 Alle modellen ⚙️ Kilo Code
Bronnen
💬 Promptbibliotheek 📖 AI-woordenlijst 🔗 Nuttige links 🔌 AI-API's en routers
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.