A lightweight AI-inspired Code Reviewer built using Python and Streamlit that analyzes Python code for syntax errors, structural issues, and basic code quality metrics.
This project demonstrates static code analysis using Pythonโs AST module and a rule-based scoring system.
- โ
Syntax error detection using
ast.parse() - ๐ Code length analysis
- ๐ Comment presence detection
- ๐ค Variable naming analysis
- ๐ Dynamic scoring system
- ๐ Grade classification (Outstanding, Excellent, Good, etc.)
- ๐ Web interface built with Streamlit
- ๐ง Modular project structure (analyzer + scorer separation)
-
User pastes Python code into the web interface.
-
The
analyzer.pymodule:- Parses code into an Abstract Syntax Tree (AST)
- Detects syntax issues
- Applies rule-based checks
-
The
scorer.pymodule:- Calculates quality score
- Assigns grade
- Generates feedback
-
Results are displayed via Streamlit UI.
- Python 3.x
- Streamlit
- AST (Abstract Syntax Tree module)
- Regular Expressions (
re)
AI_Code_Reviewer/
โ
โโโ app.py
โโโ analyzer.py
โโโ scorer.py
โโโ requirements.txt
โโโ venv/
git clone https://github.com/Yash-200608/AI_Code_Reviewer
cd AI_Code_Reviewerpython -m venv venvWindows:
venv\Scripts\activateMac/Linux:
source venv/bin/activatepip install -r requirements.txtstreamlit run app.pyThen open:
http://localhost:8501
-
Base Score: 100
-
Syntax Error: โ10
-
Each detected issue: โ3
-
Grades:
- 95+ โ Outstanding
- 85+ โ Excellent
- 75+ โ Good
- 60+ โ Average
- Below 60 โ Needs Improvement
- Understanding Python AST
- Static code analysis fundamentals
- Rule-based evaluation systems
- Web app development using Streamlit
- Debugging and modular project design
- Virtual environment management
- AST-based complexity analysis
- Cyclomatic complexity calculation
- Recursion detection
- GitHub repository analyzer
- Machine Learning-based code scoring
- Advanced UI styling
Developed by Yash as a B.Tech CSE (AIML) project to explore static code analysis and AI-inspired evaluation systems.