A robust code analysis tool for extracting patterns, understanding code structures, and analyzing repositories at scale.
- Repository Analysis: Automatically analyze codebases to extract patterns and structures
- Language Support: Comprehensive support for multiple programming languages
- Graph Database Integration: Store code relationships in Neo4j for advanced querying
- Pattern Detection: Identify code patterns, anti-patterns, and architectural structures
- Machine Learning Capabilities: Learn from repositories to improve pattern detection
- Robust Error Handling: Comprehensive exception management with retry capabilities
- Extensible Architecture: Easy to extend with new languages and patterns
- Python 3.8+
- Neo4j 4.4+
- PostgreSQL 13+
-
Clone the repository
git clone https://github.com/your-org/RepoAnalyzer.git cd RepoAnalyzer
-
Install dependencies
pip install -r requirements.txt
-
Configure database connections
# Create configuration file from template cp config/config.example.json config/config.json # Edit config.json with your database credentials
Analyze a Git repository:
python index.py --repo https://github.com/example/repository.git
Process a local codebase:
python index.py --path /path/to/codebase
RepoAnalyzer is built with a modular architecture:
- Parsers: Language-specific code parsing and pattern extraction
- Indexer: Core analysis engine that processes code files
- Database: Storage layer with Neo4j for graph relationships and PostgreSQL for metadata
- AI Tools: ML-enhanced capabilities for pattern learning and recognition
RepoAnalyzer implements a comprehensive exception handling framework:
- Standardized Error Types: Hierarchical exception classes for different error categories
- Decorated Error Boundaries: Use of decorators and context managers for consistent error handling
- Retry Mechanism: Automatic retry with exponential backoff for transient failures
- Error Auditing: Tools to analyze exception patterns and improve error handling
To run the exception handling audit:
./scripts/analyze_exception_patterns.py --verbose
# Run all tests
pytest
# Run specific test modules
pytest tests/test_parsers.py
Comprehensive documentation is available in the docs/
directory:
See the improvement roadmap for planned enhancements and current priorities.
Contributions are welcome! Please check the contributing guidelines before submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.