Break a God Function Apart
Split an oversized function into well-named pieces without changing external behavior.
Intermediate1 min read
Customize
Fill these in and the prompt below updates as you type. Anything you leave blank stays as a placeholder.
Your prompt
1 placeholder leftThis function does too many things. Split it following the Single Responsibility Principle, keeping the same external behavior. {{code}} Propose 3-6 well-named smaller functions, show each one, and show the slimmed-down orchestrator that calls them. Do not introduce new dependencies. Flag anything you were unsure about.