Skip to content

Commit b8eb84c

Browse files
committed
Create refactor_report.yaml
1 parent e6c7c0b commit b8eb84c

1 file changed

Lines changed: 91 additions & 0 deletions

File tree

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Template name (displayed in the Issue template selection list)
2+
name: 🔄 Code Refactoring Request
3+
# Template description
4+
description: Submit a code refactoring request to improve code quality, maintainability, and performance
5+
# Default Issue title (users can modify)
6+
title: "[REFACTOR] Briefly describe the refactoring content"
7+
# Auto-applied labels for the Issue
8+
labels: ["refactor", "needs review"]
9+
# Template form body (all specified fields are string type)
10+
body:
11+
# 1. Target Module/File (Required string)
12+
- type: input
13+
id: target-module
14+
attributes:
15+
label: Target Module/File
16+
description: Please enter the specific module, directory or file path to be refactored (multiple items can be separated by commas)
17+
placeholder: e.g., src/utils/request.js, src/components/Table, src/services/userService.ts
18+
validations:
19+
required: true
20+
21+
# 2. Current Code Problems (Required)
22+
- type: textarea
23+
id: code-problems
24+
attributes:
25+
label: Current Code Problems
26+
description: Detail the existing problems with the code (e.g., readability, performance, maintainability, redundancy, technical debt, etc.)
27+
placeholder: |
28+
1. Readability: The function is too long (over 200 lines) with unclear variable naming
29+
2. Performance: Nested loops lead to O(n²) time complexity, resulting in slow data processing
30+
3. Maintainability: Lack of comments and type definitions, difficult to debug and modify
31+
4. Redundancy: Duplicate code blocks exist in 3 different files, increasing maintenance costs
32+
validations:
33+
required: true
34+
35+
# 3. Refactoring Objectives (Required)
36+
- type: textarea
37+
id: refactor-objectives
38+
attributes:
39+
label: Refactoring Objectives
40+
description: Clearly state the expected outcomes and goals of the refactoring
41+
placeholder: |
42+
1. Split long functions into small, single-responsibility functions
43+
2. Optimize algorithm to reduce time complexity to O(n log n)
44+
3. Add complete type definitions and functional comments
45+
4. Extract duplicate code into public utility functions
46+
5. Improve test coverage from 60% to 90%
47+
validations:
48+
required: true
49+
50+
# 4. Refactoring Scope and Boundaries (Required)
51+
- type: input
52+
id: refactor-scope
53+
attributes:
54+
label: Refactoring Scope and Boundaries
55+
description: Specify the scope of refactoring and clear boundaries (what to change/what not to change)
56+
placeholder: e.g., Only refactor the data processing logic, do not modify the external API interface; Only adjust the code structure, do not change business logic
57+
validations:
58+
required: true
59+
60+
# 5. Risk Assessment (Optional)
61+
- type: textarea
62+
id: risk-assessment
63+
attributes:
64+
label: Risk Assessment
65+
description: List potential risks of refactoring and corresponding mitigation measures (enter "N/A" if none)
66+
placeholder: |
67+
1. Risk: May affect the existing business logic → Mitigation: Add comprehensive unit tests before refactoring
68+
2. Risk: Team members are unfamiliar with the new code structure → Mitigation: Conduct code walkthrough after refactoring
69+
3. N/A
70+
validations:
71+
required: false
72+
73+
# 6. Reference Materials (Optional string)
74+
- type: input
75+
id: reference-materials
76+
attributes:
77+
label: Reference Materials
78+
description: Enter URLs of relevant design documents, best practices or examples (enter "N/A" if none)
79+
placeholder: e.g., https://github.com/company/style-guide/blob/main/js.md, https://refactoring.guru/extract-function
80+
validations:
81+
required: false
82+
83+
# 7. Expected Completion Time (Optional string)
84+
- type: input
85+
id: expected-time
86+
attributes:
87+
label: Expected Completion Time
88+
description: Enter the expected time to complete the refactoring (enter "N/A" if not specified)
89+
placeholder: e.g., Within 1 week, Before v2.5.0 release, N/A
90+
validations:
91+
required: false

0 commit comments

Comments
 (0)