Skip to content

Latest commit

 

History

History
147 lines (103 loc) · 3.18 KB

File metadata and controls

147 lines (103 loc) · 3.18 KB

📝 Code Review Guide

For Reviewers and Contributors


🎯 Purpose

Code reviews ensure:

  • Quality - Bugs are caught early
  • Consistency - Code follows standards
  • Knowledge - Everyone learns
  • Security - Vulnerabilities are found
  • Performance - Optimization opportunities

🔍 What to Look For

1. Functionality

Check Question
Correctness Does it do what it should?
Edge Cases Are edge cases handled?
Error Handling Are errors handled gracefully?
Validation Is input validated?

2. Code Quality

Check Question
Readability Is the code easy to understand?
Naming Are names clear and consistent?
Comments Are comments helpful?
Structure Is the code well-organized?

3. Design

Check Question
Patterns Does it use appropriate patterns?
Separation Are concerns separated?
DRY Is code repeated unnecessarily?
SOLID Does it follow SOLID principles?

4. Testing

Check Question
Coverage Are all paths tested?
Quality Are tests meaningful?
Integration Does it work with other parts?

5. Performance

Check Question
Efficiency Is it efficient?
Resources Does it use resources wisely?
Scale Will it work at scale?

6. Security

Check Question
Input Is input properly sanitized?
Authentication Is auth properly handled?
Authorization Are permissions checked?
Data Is sensitive data protected?

💬 Review Comments

Good Comments

✅ "Consider using map instead of forEach here for better readability."

✅ "This function is doing too much. Could we split it into smaller functions?"

✅ "Great approach! This solves the problem elegantly."

Bad Comments

❌ "This is wrong."

❌ "Fix this."

❌ "I don't like this."

❌ "Why did you do it this way?"

Constructive Feedback

Format:

  • What: What needs to change
  • Why: Why it should change
  • How: How to change it
  • Example: Example code if needed

📋 Review Process

Step 1: First Pass

  1. Read the description
  2. Check the issue
  3. Overview
  4. Quick wins

Step 2: Detailed Review

  1. Line by line
  2. Think like the author
  3. Test mentally
  4. Check tests

Step 3: Summary

  1. Overall assessment
  2. Major issues
  3. Minor issues
  4. Recommendation

🎯 Review Outcomes

Outcome When to Use Next Steps
Approve All good Merge
Request Changes Issues need fixing Contributor fixes
Comment Questions or suggestions Discuss and decide

📊 Review Metrics

Metric Good Needs Improvement
Review Time < 24h > 48h
PR Size < 200 lines > 500 lines
Comments/PR 3-10 0 or > 20
Time to Merge < 48h > 1 week

Remember: We're all here to build something great together. Be kind, be constructive, and always keep learning. 🌱