已比較的版本

索引鍵

  • 此行已新增。
  • 此行已移除。
  • 格式已變更。

English / 中文

Goal:Utilize DaVinci to analyze code snippets.

錨點
English
English

Reference File:N/A

(灰色燈泡) The Prompt to DaVinci

...

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 DaVinci 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.

(燈泡) DaVinci Output Result

...

Result

image-20240430-024024.pngImage Added

Benift

Based on DaVinci analysis results, you will gain a better understanding of the code's efficiency.

...

目的:利用 DaVinci 分析程式碼片段

錨點
English
English

Reference File:N/A

(灰色燈泡) 提示 DaVinci 的範例

...

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.
 

...

    *A new code snippet that should be provided based on the suggestion.*
'''
Code :
{{code}}

解題思路

請達哥做為一個專業的程式設計師協助分析程式碼,分析程式碼意圖、列出潛在問題定針對問題重點review

(燈泡) DaVinci 輸出結果範例

...

Result

image-20240430-024024.png

效益

根據達哥分析結果,將更加了解程式碼的效率