shubham-repo-analyzer
v1.1.2
Published
Scan GitHub repositories and generate quality reports analyzing code quality, vulnerabilities, code review metrics, and performance
Maintainers
Readme
Git Repository Analyzer
A comprehensive Node.js tool for analyzing GitHub repositories across four critical dimensions: Code Quality, Vulnerabilities, Code Review Practices, and Performance.
Features
- 📈 Code Quality Analysis: Evaluate repository health through stars, forks, issues, documentation, and activity metrics
- 🔒 Security & Vulnerability Assessment: Identify potential security risks and recommend safeguards
- 👥 Code Review & Collaboration Metrics: Analyze pull request patterns, review velocity, and team collaboration
- ⚡ Performance & Release Analysis: Track release frequency, development velocity, and code frequency patterns
- 📊 Comprehensive Reports: Generate detailed reports with actionable recommendations
- 🔄 Batch Analysis: Analyze multiple repositories in one operation
Installation
- Clone or download the repository
- Install dependencies:
npm install- (Optional) Configure GitHub token for authenticated requests:
npm run analyze -- configCreate a .env file in the root directory:
GITHUB_TOKEN=your_github_personal_access_tokenUsage
Analyze a Single Repository
npm run analyze -- analyze owner/repo-nameExample:
npm run analyze -- analyze facebook/reactSave Report to File
npm run analyze -- analyze owner/repo-name --output ./reports/report.jsonAnalyze Multiple Repositories
Create a file repos.txt with one repository per line:
facebook/react
torvalds/linux
kubernetes/kubernetes
nodejs/nodeThen run:
npm run analyze -- batch repos.txt --output-dir ./reportsView Configuration
npm run analyze -- configReport Sections
1. Code Quality
- Stars, forks, watchers
- Open issues count
- Primary language and languages used
- Days since last update
- Documentation presence
- Topics and tags
2. Security & Vulnerability
- Risk level assessment (Critical, High, Medium, Low)
- Risk factors identification
- Security feature status
- Maintenance status
- Actionable recommendations
3. Code Review & Collaboration
- Pull request metrics (total, open, merged, closure rate)
- Average review time
- Contributor count
- Commit patterns and unique authors
- Review velocity analysis
4. Performance & Release
- Release frequency and patterns
- Development velocity trends
- Code activity analysis
- Weekly additions and deletions
- Release cadence recommendations
Environment Variables
GITHUB_TOKEN: Personal access token for authenticated API requests (increases rate limit from 60 to 5000 requests/hour)
Optional: Local Ollama
Ollama is optional. The web app uses it when you choose Ollama as the LLM or when calling /api/ollama-analyze. You need OLLAMA_MODEL set and the Ollama service running.
Setup:
- Install Ollama for your OS from ollama.com and start it (default API:
http://127.0.0.1:11434). - Run the model you reference in
OLLAMA_MODEL, for example:ollama run <modelname>.
Example .env (Ollama-related):
OLLAMA_MODEL=gemma4:31b-cloud
OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_TIMEOUT_MS=300000| Variable | Description |
|----------|-------------|
| OLLAMA_MODEL | Model tag Ollama uses for analysis (pull it with ollama pull or use a model your install supports). |
| OLLAMA_BASE_URL | Ollama HTTP API base URL; local default is http://127.0.0.1:11434. |
| OLLAMA_TIMEOUT_MS | Max wait time in milliseconds for Ollama requests (large repos may need a higher value). |
Restart the Node server after changing .env so new values load.
API Rate Limits
- Without token: 60 requests per hour (IP-based)
- With token: 5000 requests per hour (user-based)
Project Structure
src/
├── index.js # Main entry point
├── cli.js # Command-line interface
├── github/
│ └── client.js # GitHub API client
├── analyzers/
│ ├── quality.js # Code quality analyzer
│ ├── vulnerability.js # Security analyzer
│ ├── codeReview.js # Code review analyzer
│ └── performance.js # Performance analyzer
└── report/
└── generator.js # Report generationExample Output
📊 GitHub Repository Analysis Report
Repository: facebook/react
Generated: 2/10/2026, 10:30:45 AM
🎯 Overall Score: 92/100
[████████████████████░░░░░░]
📈 Code Quality Analysis
Quality Score: 95/100
┌────────────────────┬─────────┐
│ Metric │ Value │
├────────────────────┼─────────┤
│ Stars │ 215000 │
│ Forks │ 44000 │
│ Open Issues │ 1200 │
└────────────────────┴─────────┘
[Additional sections for security, code review, and performance...]Technologies Used
- axios: HTTP client for API requests
- commander: CLI framework
- chalk: Terminal colors
- table: Formatted table output
- dotenv: Environment variable management
Error Handling
The analyzer handles various error scenarios:
- Invalid repository format
- Network errors
- API rate limit exceeded
- Repository not found
- Insufficient permissions
Contributing
Feel free to submit issues and enhancement requests!
License
MIT License - See LICENSE file for details
Support
For issues, questions, or suggestions, please open an issue in the repository.
