A robust code auditing and analysis tool that leverages AI to evaluate software projects across multiple dimensions.
- Repository Analysis: Analyze local repositories or GitHub projects
- AI-Powered Evaluation: Integrates with OpenAI GPT-4.1 for intelligent code analysis
- Web Interface: Intuitive browser-based interface for managing audits
- Real-time Progress Tracking: Monitor audit progress with live updates
- Multi-category Evaluation:
- Code Quality
- Functionality
- Security
- Innovation
- Documentation
- UX Design
- Blockchain Integration
- Detailed Reports: Comprehensive Markdown reports with scoring and feedback
- Customizable Configuration: Configure categories and scoring criteria
- Python 3.7+
- OpenAI API key (environment variable:
OPENAI_API_KEY) - Git (for repository operations)
-
Clone this repository:
git clone https://github.com/username/code-sorcerer.git cd code-sorcerer -
Install dependencies:
pip install -r requirements.txt
-
Set up your OpenAI API key:
export OPENAI_API_KEY="your-api-key-here"
-
Start the web server:
python main.py # Or use Gunicorn: gunicorn --bind 0.0.0.0:5000 main:app -
Open your browser and navigate to http://localhost:5000
# Run an audit on a local repository
python -m audit_near /path/to/repository
# Run an audit on a GitHub repository
python -m audit_near https://github.com/username/repository
# Run with a custom configuration file
python -m audit_near /path/to/repository --config /path/to/config.toml
# Output to a specific file
python -m audit_near /path/to/repository --output /path/to/output.mdCode Sorcerer consists of the following key components:
- Web Interface - Flask-based web application for user interaction
- Audit Engine - Core audit processing and orchestration
- Repository Providers - Handling different repository sources (local, GitHub)
- AI Client - Integration with OpenAI for code analysis
- Category Processors - Analysis of specific project aspects
- Report Generator - Creation of detailed markdown reports
Evaluates code structure, readability, maintainability, and adherence to best practices.
Assesses feature completeness, correctness, and robustness.
Evaluates security practices, vulnerability prevention, and data protection.
Measures originality, creativity, and novel approaches to problem-solving.
Assesses comprehensiveness, clarity, and helpfulness of documentation.
Evaluates usability, accessibility, and overall user experience.
Assesses proper integration with blockchain technologies and smart contracts.
The repository includes several sample audit reports for reference:
- Smart Contract Project Audit
- Web Application Audit
- Frontend Application Audit
- Blockchain Integration Audit
Code Sorcerer is highly configurable through TOML configuration files. The default configuration is located in configs/near_hackathon.toml.
Example configuration:
[general]
name = "Code Sorcerer"
version = "0.1.0"
description = "Comprehensive code audit and analysis tool"
[categories.code_quality]
name = "Code Quality"
max_points = 10
description = "Evaluates code structure, readability, maintainability, and adherence to best practices"
# Additional category configurations...
[ai]
primary_model = "gpt-4.1-2025-04-14"
nano_model = "gpt-4.1-nano-2025-04-14"Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.