Use the prompt
Share the code and the cases it needs to handle. Tests can help you check that splitting the implementation into smaller pieces doesn't change the behavior.
Break down complex functions into testable, maintainable components. Reduce cognitive load for future developers.
For GitLab Duo
This code is too complex:
[PASTE CODE]
Help me:
1. Break it into smaller functions
2. Reduce cyclomatic complexity
3. Make it easier to test
4. Improve maintainabilityShare the code and the cases it needs to handle. Tests can help you check that splitting the implementation into smaller pieces doesn't change the behavior.