Use the prompt
Include the code and explain which parts readers struggle to understand. Reviewing the result alongside its tests helps keep a readability change from becoming an unintended behavior change.
Improve code readability with better names, simplified logic, and clearer structure. Make code self-documenting.
For GitLab Duo
Refactor this code for better readability:
[PASTE CODE]
Focus on:
1. Clear variable names
2. Simplified logic
3. Better function decomposition
4. Appropriate commentsInclude the code and explain which parts readers struggle to understand. Reviewing the result alongside its tests helps keep a readability change from becoming an unintended behavior change.