Overview
OpenHands enhances your code review process by:- Automated analysis: Detecting bugs, security issues, and code smells
- Standards enforcement: Checking adherence to coding guidelines
- Improvement suggestions: Recommending better patterns and practices
- Documentation: Generating summaries and explanations of changes
Automated Code Review
Code Quality Analysis
OpenHands can analyze code changes for quality issues:| Category | Issues Detected |
|---|---|
| Complexity | Long methods, deep nesting, high cyclomatic complexity |
| Maintainability | Code duplication, unclear naming, missing documentation |
| Reliability | Null pointer risks, unhandled exceptions, race conditions |
| Performance | N+1 queries, unnecessary allocations, inefficient algorithms |
Style and Standards Enforcement
Ensure code follows your team’s standards:Bug Detection
Identify potential bugs before they ship:- Logic Errors
- Resource Leaks
- Concurrency
Review Assistance
Generating Review Comments
Get detailed review comments for a PR:Identifying Potential Issues
Proactively find issues that might cause problems:Suggesting Improvements
Get suggestions for making code better:Integration
GitHub Pull Request Integration
OpenHands integrates with GitHub for automated PR reviews:- Install the GitHub App: See GitHub Integration
- Configure auto-review: Enable automatic review on PR creation
- Trigger manual reviews: Comment
@openhands reviewon any PR
GitLab Merge Request Integration
For GitLab users:- Install the GitLab integration: See GitLab Integration
- Configure webhook triggers: Enable review on MR creation
- Manual trigger: Comment
/openhands reviewon any MR
CI/CD Pipeline Integration
Add code review to your CI/CD pipeline:- GitHub Actions
- GitLab CI
- Generic
Best Practices
Effective Review Prompts
Write prompts that get useful reviews:Combining Human and AI Review
Get the best of both worlds:-
First pass: OpenHands
- Automated checks for common issues
- Consistency verification
- Initial quality assessment
-
Second pass: Human reviewer
- Architecture and design decisions
- Business logic correctness
- Knowledge transfer and mentoring
-
Final pass: Author response
- Address all feedback
- Explain any disagreements
- Request re-review if needed
Review Scope Guidelines
| Change Size | Recommended Approach |
|---|---|
| Small (under 50 lines) | Full automated review |
| Medium (50-200 lines) | Automated + focused human review |
| Large (over 200 lines) | Split PR or section-by-section review |
| Refactoring | Focus on behavior preservation |
| New feature | Focus on design and test coverage |
Examples
Security-Focused Review
Performance Review
API Review
Related Resources
- GitHub Integration - Set up GitHub integration
- GitLab Integration - Set up GitLab integration
- Integrations Overview - All available integrations
- Prompting Best Practices - Write effective prompts

