레거시 코드 리팩토링
저장소의 레거시 코드를 리팩토링합니다.
기존 코드의 성능, 가독성 또는 유지 관리성을 향상시켜야 할 때 다음 가이드라인을 따르세요. 예상 시간: 15-30분 수준: 중급 전제 조건: IDE에 코드 파일 열기, GitLab Duo Chat 사용 가능 과제 # 기능을 손상시키지 않고 복잡하고 유지 관리하기 어려운 코드를 깔끔하고 테스트 가능한 컴포넌트로 변환합니다. 접근 방법 # GitLab Duo Chat과 Code Suggestions를 사용하여 분석, 계획 및 구현합니다. 1단계: 분석 # GitLab Duo Chat을 사용하여 현재 상태를 이해합니다. 리팩토링할 코드를 선택한 후 다음을 요청합니다: Analyze the [ClassName] in [file_path]. Focus on: 1. Current methods and their complexity 2. Performance bottlenecks 3. Areas where readability can be improved 4. Potential design patterns that could be applied Provide specific examples from the code and suggest applicable refactoring patterns. 예상 결과: 구체적인 개선 제안이 포함된 상세한 분석. 2단계: 계획 # GitLab Duo Chat을 사용하여 구조화된 제안을 작성합니다. Based on your analysis of [ClassName], create a refactoring plan: 1. Outline the new structure 2. Suggest new method names and their purposes 3. Identify any new classes or modules needed 4. Explain how this improves [performance/readability/maintainability] Format as a structured plan with clear before/after comparisons. 예상 결과: 단계별 리팩토링 로드맵. 3단계: 구현 # GitLab Duo Chat을 사용하여 리팩토링된 코드를 생성합니다. 그런 다음 코드를 적용하고 Code Suggestions를 사용하여 구문을 지원합니다. Implement the refactoring plan for [ClassName]: 1. Create the new [language] file following our coding standards 2. Include detailed comments explaining changes 3. Update [related_file] to use the new structure 4. Write tests for the new implementation Follow [style_guide] and document any design decisions. 예상 결과: 테스트가 포함된 완전히 리팩토링된 코드. 팁 # 구현에 앞서 분석부터 시작합니다. C
