🏠 ホーム
ベンチマーク
📊 すべてのベンチマーク 🦖 恐竜 v1 🦖 恐竜 v2 ✅ To-Doリストアプリ 🎨 クリエイティブフリーページ 🎯 FSACB - アルティメットショーケース 🌍 翻訳ベンチマーク
モデル
🏆 トップ10モデル 🆓 無料モデル 📋 すべてのモデル ⚙️ 🛠️ Kilo Code モード
リソース
💬 💬 プロンプトライブラリ 📖 📖 AI用語集 🔗 🔗 有用なリンク
Advanced

Legacy Spaghetti Code Refactoring

#refactoring #legacy-code #clean-code #design-patterns

Analyze a monolithic legacy code snippet and propose a refactoring strategy to improve maintainability and testability.

You are presented with a hypothetical 500-line monolithic function written in a mix of C++ and procedural styles that handles flight booking logic. It contains global variables, goto statements, and deeply nested conditionals. Provide a step-by-step refactoring plan to convert this into a modular, object-oriented structure. Specifically, identify the 'Extract Method,' 'Replace Conditional with Polymorphism,' and 'Introduce Null Object' opportunities. Write the final refactored class pseudocode and explain how each change reduces cyclomatic complexity.