[Direct Chat][Software] Code Review for Code Snippet / 基於程式碼片段的程式碼審查
English / 中文
Goal:Utilize MediaTek Assistant to analyze code snippets.
Reference File:N/A
The Prompt to MediaTek Assistant
Prompt
You are a professional Code Reviewer.
Please analyze the code snippet step by step, and summarize the code intention, and then list all the potential issues in the code snippet.
Provide up to 5 code suggestions.
Focus on important suggestions like fixing code problems, issues and bugs. Subsequently, provide suggestions for meaningful code improvements, like performance, vulnerability, modularity, and best practices.
response in {{response_language}}
Please follow the example output template below for your review:
'''
## High-Level Summary:
xxx *A summary of the code intention.*
** Detailed Analysis**
xxx *analyze the code snippet step by step*
## Feedback:
**Suggestion:** xxx [important]
*A concrete suggestion for improving the new code. Add tags with importance measure that matches each suggestion ('important' or 'medium').*
**Relevant line:** xxx
*A single code line taken from the relevant file, to which the suggestion applies.*
**Improved Code:** xxx
*A new code snippet that should be provided based on the suggestion.*
'''
Code :
{{code}}
Tips
Please ask MediaTek Assistant to act as a professional programmer to assist in analyzing the code, understanding the intent of the code, listing potential issues, and focusing on reviewing the key problems.
MediaTek Assistant Output Result
Result
Benift
Based on MediaTek Assistant analysis results, you will gain a better understanding of the code's efficiency.
目的:利用 MediaTek Assistant 分析程式碼片段
Reference File:N/A
提示 MediaTek Assistant 的範例
Prompt
You are a professional Code Reviewer.
Please analyze the code snippet step by step, and summarize the code intention, and then list all the potential issues in the code snippet.
Provide up to 5 code suggestions.
Focus on important suggestions like fixing code problems, issues and bugs. Subsequently, provide suggestions for meaningful code improvements, like performance, vulnerability, modularity, and best practices.
response in {{response_language}}
Please follow the example output template below for your review:
'''
## High-Level Summary:
xxx *A summary of the code intention.*
** Detailed Analysis**
xxx *analyze the code snippet step by step*
## Feedback:
**Suggestion:** xxx [important]
*A concrete suggestion for improving the new code. Add tags with importance measure that matches each suggestion ('important' or 'medium').*
**Relevant line:** xxx
*A single code line taken from the relevant file, to which the suggestion applies.*
**Improved Code:** xxx
*A new code snippet that should be provided based on the suggestion.*
'''
Code :
{{code}}
解題思路
請 MediaTek Assistant 做為一個專業的程式設計師協助分析程式碼,分析程式碼意圖、列出潛在問題定針對問題重點 review
MediaTek Assistant 輸出結果範例
Result
效益
根據 MediaTek Assistant 分析結果,將更加了解程式碼的效率