AI Code Checker
AI Code Checker is an innovative tool that leverages Large Language Models (LLMs) to provide intelligent code analysis and feedback. By combining automated testing with AI-powered code review, the tool delivers comprehensive, human-like feedback on code quality, implementation, and potential improvements.
Key Features
- Automated Test Execution and Analysis: Run tests automatically and analyze results seamlessly.
- AI-Powered Code Quality Assessment: Utilize state-of-the-art LLMs to evaluate code quality and provide detailed insights.
- Detailed Scoring with Explanations: Receive a comprehensive score breakdown with clear, actionable explanations.
- Intelligent Issue Detection and Prioritization: Identify and prioritize potential issues in your codebase.
- Actionable Improvement Suggestions: Get tailored suggestions with severity levels to improve your code.
- Beautiful, Responsive UI: Built with Streamlit, the tool offers a sleek and user-friendly interface.
- Light and Dark Mode Support: Choose between light and dark themes for a comfortable user experience.
- Real-Time Feedback Generation: Instantly generate feedback as you write or upload code.
New Features
- Dynamic Package Management: Automatically detects and installs required packages for testing.
- Secure Docker Integration: Runs tests in isolated containers with proper permissions.
- Smart Import Detection: Recognizes common package aliases (e.g., 'np' for numpy).
- Enhanced Error Handling: Provides clear feedback for setup and execution issues.
- Structured Test Results: Organized display of test outcomes with severity indicators.
- Expanded Test Coverage: Support for various Python testing frameworks.
- Performance Optimization: Efficient test execution with parallel processing.
- Clean Output Format: Filtered test results without system warnings.
Technical Stack
- Programming Language: Python
- UI Framework: Streamlit
- AI Backend: Google's Generative AI for intelligent analysis
- Testing Framework: Custom test execution framework with unittest integration
- Container Technology: Docker for isolated test environments
- Package Management: Dynamic dependency detection and installation
- Security: Non-root user execution in containers
- Parsing: Advanced regex for test result analysis
- Feedback System: JSON-based structured feedback
System Requirements
- Python 3.9 or higher
- Docker installed and running
- Internet connection for AI analysis
- Sufficient disk space for Docker images
Installation
# Clone the repository
https://github.com/SageSquash/ai_codeChecker.git
# Navigate to project directory
cd ai-code-checker
# Create virtual environment
python -m venv .venv
# Activate virtual environment
source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # Windows
# Install requirements
pip install -r requirements.txt
# Build Docker image
docker build -t python-test-runner:v1 .
Usage
- Start the application:
streamlit run app.py
- Configure your Google API key in the sidebar
- Choose input method (file upload or paste code)
- Click "Generate Tests" to create test cases
- Run tests to get comprehensive analysis
Features in Detail
Dynamic Package Management
- Automatic detection of required packages
- Support for common package aliases
- Seamless installation in test environment
Secure Testing Environment
- Isolated Docker containers
- Non-root user execution
- Clean environment for each test run
Comprehensive Results
- Detailed test outcomes
- Pass/fail metrics
- Code quality insights
- Severity-based issue categorization
AI-Powered Analysis
- Context-aware feedback
- Pattern recognition
- Best practice suggestions
- Performance insights
Why AI Code Checker?
This project showcases the practical implementation of AI/LLM technology in software development workflows. It demonstrates both technical expertise and a deep understanding of real-world developer needs, making it an invaluable tool for improving code quality and developer productivity.
Key Benefits
- Automated Dependency Management: No manual package installation required
- Secure Execution: Isolated testing environment for safety
- Comprehensive Analysis: Combined automated and AI-powered testing
- User-Friendly Interface: Clear, organized result presentation
- Actionable Insights: Practical improvement suggestions