Skip to content

This GPT automatic code reviewer analyzes code files, providing detailed feedback and suggestions for improving code style, performance, readability, and maintainability. It offers interactive options to accept or reject suggestions before auto-saving changes, simplifying the code review process.

Notifications You must be signed in to change notification settings

qmeng222/CodeReviewer-AI

Repository files navigation

Interactive Code Reviewer-AI

About the project:

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

Setup:

  1. Install OpenAI: pip install openai
  2. Install the Python package called python-dotenv: pip install python_dotenv
  3. Install the tenacity package: pip install tenacity

Run:

  1. Execute the interactive code reviewer to analyze and assess any test file.: python reviewer.py test_file.py
  2. 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.
  3. Once the changes are accepted, the Reviewer automatically saves the modified code.
  4. Terminate the code reviewer at anytime: Ctrl + C

About

This GPT automatic code reviewer analyzes code files, providing detailed feedback and suggestions for improving code style, performance, readability, and maintainability. It offers interactive options to accept or reject suggestions before auto-saving changes, simplifying the code review process.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages