A comprehensive repository analysis tool that extracts metrics and insights from Git repositories to assess health, quality, and development patterns.
- Commit history analysis
- Branch and tag statistics
- Activity tracking (90-day windows)
- Language detection and LOC estimation
- Bus factor calculation
- Top contributor identification
- Active contributor tracking
- Contributor activity trends
- Test-to-code ratio
- Large file detection
- Comment density analysis
- Average file size metrics
- Knowledge silo detection
- Dormant contributor identification
- Onboarding effectiveness
- Cross-contributor collaboration patterns
- Commit size distribution
- Merge vs. regular commits
- Revert frequency
- Commit message quality (conventional commits)
- Time-based patterns (hour/day)
- Bug fix tracking
- README presence
- Architecture documentation
- Runbooks and guides
- API documentation
- Onboarding score calculation
- Dependency detection (npm, NuGet, pip, Go modules, etc.)
- Framework identification
- Containerization usage
- Infrastructure as Code detection
- Cloud provider identification
- CI system detection (GitHub Actions, Azure Pipelines, GitLab CI, etc.)
- Configuration validation
- Stale branch detection
- Branch lifespan analysis
- Active branch tracking
- Monthly commit trends
- Growth metrics (LOC, commits, contributors)
- Historical patterns
- File churn analysis
- High-change area detection
The project follows clean architecture principles with clear separation of concerns:
RepoScan/
├── Program.cs # Entry point and orchestration
├── Models/ # Data models
│ ├── AnalysisResult.cs # Result models and DTOs
│ ├── ContributorStat.cs # Contributor data model
│ └── RepoFile.cs # File representation
├── Analyzers/ # Analysis logic
│ ├── CommitAnalyzer.cs # Commit pattern analysis
│ ├── ContributorAnalyzer.cs # Contributor metrics
│ ├── FileAnalyzer.cs # File and quality analysis
│ ├── DocumentationAnalyzer.cs # Documentation assessment
│ ├── ArchitectureAnalyzer.cs # Architecture detection
│ ├── CiCdAnalyzer.cs # CI/CD configuration
│ ├── DependencyAnalyzer.cs # Dependency parsing
│ ├── BranchAnalyzer.cs # Branch management
│ └── TrendAnalyzer.cs # Trend calculation
├── Services/ # Application services
│ ├── RepositoryAnalysisService.cs # Main analysis orchestration
│ └── OutputService.cs # JSON output formatting
└── Utilities/ # Helper utilities
├── LanguageDetector.cs # File extension to language mapping
├── FileClassifier.cs # File type classification
└── Logger.cs # Logging utilities
# Analyze current directory
dotnet run
# Analyze specific repository
dotnet run /path/to/repository
# Save output to file (logs still visible)
dotnet run /path/to/repository > output.jsonThe tool outputs comprehensive JSON containing:
- Repository metadata
- Health metrics
- Contributor statistics
- Quality indicators
- Documentation scores
- Architecture details
- Commit patterns
- Collaboration metrics
- Dependency information
- Branch analysis
- Growth trends
- Hotspot files
All progress and diagnostic messages are written to stderr, keeping the JSON output on stdout clean for piping or redirection.
- LibGit2Sharp - Git repository access and analysis
- .NET 10.0 - Runtime framework
# Build
dotnet build
# Run tests (if available)
dotnet test
# Publish
dotnet publishTo add new analysis features:
- Create a new analyzer in
Analyzers/ - Add corresponding model classes in
Models/AnalysisResult.cs - Update
RepositoryAnalysisServiceto call the new analyzer - The output will automatically include the new metrics in JSON
[Add your license here]