This project provides an AI-powered automated code reviewer that checks uploaded source code files for:
- Code Style & Consistency (via
CodeStyle.py) - DRY & Modularity (via
DRY.py) - Security Compliance (via
Security.py)
It offers an interactive Gradio UI where users can upload multiple Python files, review them automatically, and download a structured Excel report.
ReviewAgents/
│── CodeStyle.py # Agent for code style & consistency checks
│── DRY.py # Agent for modularity & DRY checks
│── Security.py # Agent for security checks
Gradio_AICodeReviewer.ipynb # Main notebook with Gradio UI
uploaded_folder_gradio/ # Temporary folder for uploaded files
ai_code_review_reports/ # Stores generated Excel reports
- Gradio-based interface for uploading & reviewing files.
- Supports multiple file uploads in one session.
- Each review covers:
- Repository-level insights
- File-level findings
- Line-level issues with suggested fixes
- Excel reports with 3 sheets:
- Repository-Level Report
- File-Level Report
- Line-Level Report
- Reports include scores, comments, and recommendations.
- Uploaded files are deleted automatically after processing.
Each review generates an Excel file inside ai_code_review_reports/, structured as:
- Repository-Level Report → Overall project health, key risks, and compliance.
- File-Level Report → File-wise issues, modularity, maintainability scores.
- Line-Level Report → Specific code line issues, suggested fixes, security vulnerabilities.
Install the required dependencies:
pip install pydantic langchain langchain_groq langchain-core langgraph python-dotenv bandit detect-secrets gradio pandas openpyxl XlsxWriter pylint openai✅
datetimeis part of Python’s standard library, no need to install separately.
-
Clone this repository
git clone https://github.com/your-username/ai-code-reviewer.git cd ai-code-reviewer -
Install dependencies (see above).
-
Run the notebook
OpenGradio_AICodeReviewer.ipynbin Jupyter/VS Code and execute the cells. -
Upload your files
- Drag & drop Python files into the Gradio interface.
- Files are saved temporarily in
uploaded_folder_gradio/.
-
Get your report
- Processed results are saved in
ai_code_review_reports/as an Excel file. - Uploaded files are auto-deleted after review.
- Processed results are saved in
- Bandit → Detects common Python security issues.
- Detect-Secrets → Identifies hardcoded secrets and credentials.
- Pylint → Ensures PEP8 compliance and code quality.
CodeStyle.py→ Linting, naming conventions, formatting, docstrings.DRY.py→ Repetition detection, modularity improvements, refactoring suggestions.Security.py→ Security compliance, secret detection, vulnerability scanning.
- Reports are generated in Excel format (
.xlsx) for easy sharing. - Supports multiple file uploads per run.
- Designed for extensibility → You can add new agents inside
ReviewAgents/.
MIT License – feel free to use, modify, and share.