-
Purpose: CodeReviewer-AI is an innovative project designed to streamline the process of code review. It utilizes the power of GPT (Generative Pre-trained Transformer) technology to automatically analyze code files, provide detailed feedback, and suggest improvements in terms of style, performance, readability, and maintainability.
-
Analysis: The code reviewer works by ingesting code files and analyzing them using advanced natural language processing algorithms. It examines the code structure, syntax, naming conventions, and various programming best practices. Based on this analysis, it generates a comprehensive report with a list of suggestions for enhancing the code quality.
-
Feedback: The feedback generated by the GPT Automatic Code Reviewer is presented in an interactive and user-friendly interface. The reviewer goes beyond simple suggestions and provides detailed explanations for each recommendation, enabling developers to grasp the underlying reasoning behind the suggested changes. Within the interface, users are offered the flexibility to accept or decline the proposed modifications, or respond with a new prompt. This empowers developers to make informed decisions and engage in meaningful interactions throughout the code review process.
-
Controls & Auto-Save: One of the key features of this project is the ability to preview the suggested changes before making any modifications. This ensures that developers have full control over the codebase and can selectively apply the suggested improvements according to their preferences or communicate back directly to the GPT Code Reviewr. Once the changes are accepted, the GPT Automatic Code Reviewer automatically saves the modified code, simplifying the process of integrating the suggested improvements into the codebase.
- Install OpenAI:
pip install openai
- Install the Python package called python-dotenv:
pip install python_dotenv
- Install the tenacity package:
pip install tenacity
- Execute the interactive code reviewer to analyze and assess any test file.:
python reviewer.py test_file.py
- The feedback generated by the GPT Automatic Code Reviewer is presented in an interactive and user-friendly interface, offers options to accept (Y), or reject (N) the proposed modifications, or respond with a new prompt.
- Once the changes are accepted, the Reviewer automatically saves the modified code.
- Terminate the code reviewer at anytime: Ctrl + C