GitLab Well Architected
Cookbook navigation
Prompts / Identify Code Duplication Opportunities

Identify Code Duplication Opportunities

Code UnderstandingDeveloperMaintenanceRefactoringCreateBeginner

Find similar code patterns that could be consolidated into shared utilities. Reduce maintenance burden through DRY principles.

For GitLab Duo

prompt

Find places in the codebase where we implement similar logic to [DESCRIBE FUNCTIONALITY]. Could these be consolidated?

Use the prompt

Describe the behavior you're looking for and make the relevant repository available. Review differences in callers and error handling before deciding that similar implementations should be combined.