Note: Bundled scripts ship as Markdown reference (.md) — copy the code out of the .md file to run it.
Code Reviewer
Automated code review tools for analyzing pull requests, detecting code quality issues, and generating review reports.
Table of Contents
Tools
PR Analyzer
Analyzes git diff between branches to assess review complexity and identify risks.
# Analyze current branch against main
python scripts/pr_analyzer.py /path/to/repo
# Compare specific branches
python scripts/pr_analyzer.py . --base main --head feature-branch
# JSON output for integration
python scripts/pr_analyzer.py /path/to/repo --json
What it detects:
- Hardcoded secrets (passwords, API keys, tokens)
- SQL injection patterns (string concatenation in queries)
- Debug statements (debugger, console.log)
- ESLint rule disabling
- TypeScript
any types
- TODO/FIXME comments
Output includes:
- Complexity score (1-10)
- Risk categorization (critical, high, medium, low)
- File prioritization for review order
- Commit message validation
Code Quality Checker
Analyzes source code for structural issues, code smells, and SOLID violations.
# Analyze a directory
python scripts/code_quality_checker.py /path/to/code
# Analyze specific language
python scripts/code_quality_checker.py . --language python
# JSON output
python scripts/code_quality_checker.py /path/to/code --json
What it detects:
- Long functions (>50 lines)
- Large files (>500 lines)
- God classes (>20 methods)
- Deep nesting (>4 levels)
- Too many parameters (>5)
- High cyclomatic complexity
- Missing error handling
- Unused imports
- Magic numbers
Thresholds:
| Issue |
Threshold |
| Long function |
>50 lines |
| Large file |
>500 lines |
| God class |
>20 methods |
| Too many params |
>5 |
| Deep nesting |
>4 levels |
| High complexity |
>10 branches |
Review Report Generator
Combines PR analysis and code quality findings into structured review reports.
# Generate report for current repo
python scripts/review_report_generator.py /path/to/repo
# Markdown output
python scripts/review_report_generator.py . --format markdown --output review.md
# Use pre-computed analyses
python scripts/review_report_generator.py . \
--pr-analysis pr_results.json \
--quality-analysis quality_results.json
Report includes:
- Review verdict (approve, request changes, block)
- Score (0-100)
- Prioritized action items
- Issue summary by severity
- Suggested review order
Verdicts:
| Score |
Verdict |
| 90+ with no high issues |
Approve |
| 75+ with ≤2 high issues |
Approve with suggestions |
| 50-74 |
Request changes |
| <50 or critical issues |
Block |
Reference Guides
Code Review Checklist
references/code_review_checklist.md
Systematic checklists covering:
- Pre-review checks (build, tests, PR hygiene)
- Correctness (logic, data handling, error handling)
- Security (input validation, injection prevention)
- Performance (efficiency, caching, scalability)
- Maintainability (code quality, naming, structure)
- Testing (coverage, quality, mocking)
- Language-specific checks
Coding Standards
references/coding_standards.md
Language-specific standards for:
- TypeScript (type annotations, null safety, async/await)
- JavaScript (declarations, patterns, modules)
- Python (type hints, exceptions, class design)
- Go (error handling, structs, concurrency)
- Swift (optionals, protocols, errors)
- Kotlin (null safety, data classes, coroutines)
Common Antipatterns
references/common_antipatterns.md
Antipattern catalog with examples and fixes:
- Structural (god class, long method, deep nesting)
- Logic (boolean blindness, stringly typed code)
- Security (SQL injection, hardcoded credentials)
- Performance (N+1 queries, unbounded collections)
- Testing (duplication, testing implementation)
- Async (floating promises, callback hell)
Languages Supported
| Language |
Extensions |
| Python |
.py |
| TypeScript |
.ts, .tsx |
| JavaScript |
.js, .jsx, .mjs |
| Go |
.go |
| Swift |
.swift |
| Kotlin |
.kt, .kts |
Creator: Engineering Team
License: MIT
Source Repo: neekware/dojo-skills
Source Bucket: engineering-team
Original Path: engineering-team/code-reviewer
1---2name: code-reviewer-23description: > **Note:** Bundled scripts ship as Markdown reference (`.md`) — copy the code out of the `.md` file to run it.4---5> **Note:** Bundled scripts ship as Markdown reference (`.md`) — copy the code out of the `.md` file to run it.67# Code Reviewer89Automated code review tools for analyzing pull requests, detecting code quality issues, and generating review reports.1011---1213## Table of Contents1415- [Tools](#tools)16 - [PR Analyzer](#pr-analyzer)17 - [Code Quality Checker](#code-quality-checker)18 - [Review Report Generator](#review-report-generator)19- [Reference Guides](#reference-guides)20- [Languages Supported](#languages-supported)2122---2324## Tools2526### PR Analyzer2728Analyzes git diff between branches to assess review complexity and identify risks.2930```bash31# Analyze current branch against main32python scripts/pr_analyzer.py /path/to/repo3334# Compare specific branches35python scripts/pr_analyzer.py . --base main --head feature-branch3637# JSON output for integration38python scripts/pr_analyzer.py /path/to/repo --json39```4041**What it detects:**4243- Hardcoded secrets (passwords, API keys, tokens)44- SQL injection patterns (string concatenation in queries)45- Debug statements (debugger, console.log)46- ESLint rule disabling47- TypeScript `any` types48- TODO/FIXME comments4950**Output includes:**5152- Complexity score (1-10)53- Risk categorization (critical, high, medium, low)54- File prioritization for review order55- Commit message validation5657---5859### Code Quality Checker6061Analyzes source code for structural issues, code smells, and SOLID violations.6263```bash64# Analyze a directory65python scripts/code_quality_checker.py /path/to/code6667# Analyze specific language68python scripts/code_quality_checker.py . --language python6970# JSON output71python scripts/code_quality_checker.py /path/to/code --json72```7374**What it detects:**7576- Long functions (>50 lines)77- Large files (>500 lines)78- God classes (>20 methods)79- Deep nesting (>4 levels)80- Too many parameters (>5)81- High cyclomatic complexity82- Missing error handling83- Unused imports84- Magic numbers8586**Thresholds:**8788| Issue | Threshold |89| --------------- | ------------ |90| Long function | >50 lines |91| Large file | >500 lines |92| God class | >20 methods |93| Too many params | >5 |94| Deep nesting | >4 levels |95| High complexity | >10 branches |9697---9899### Review Report Generator100101Combines PR analysis and code quality findings into structured review reports.102103```bash104# Generate report for current repo105python scripts/review_report_generator.py /path/to/repo106107# Markdown output108python scripts/review_report_generator.py . --format markdown --output review.md109110# Use pre-computed analyses111python scripts/review_report_generator.py . \112 --pr-analysis pr_results.json \113 --quality-analysis quality_results.json114```115116**Report includes:**117118- Review verdict (approve, request changes, block)119- Score (0-100)120- Prioritized action items121- Issue summary by severity122- Suggested review order123124**Verdicts:**125126| Score | Verdict |127| ----------------------- | ------------------------ |128| 90+ with no high issues | Approve |129| 75+ with ≤2 high issues | Approve with suggestions |130| 50-74 | Request changes |131| <50 or critical issues | Block |132133---134135## Reference Guides136137### Code Review Checklist138139`references/code_review_checklist.md`140141Systematic checklists covering:142143- Pre-review checks (build, tests, PR hygiene)144- Correctness (logic, data handling, error handling)145- Security (input validation, injection prevention)146- Performance (efficiency, caching, scalability)147- Maintainability (code quality, naming, structure)148- Testing (coverage, quality, mocking)149- Language-specific checks150151### Coding Standards152153`references/coding_standards.md`154155Language-specific standards for:156157- TypeScript (type annotations, null safety, async/await)158- JavaScript (declarations, patterns, modules)159- Python (type hints, exceptions, class design)160- Go (error handling, structs, concurrency)161- Swift (optionals, protocols, errors)162- Kotlin (null safety, data classes, coroutines)163164### Common Antipatterns165166`references/common_antipatterns.md`167168Antipattern catalog with examples and fixes:169170- Structural (god class, long method, deep nesting)171- Logic (boolean blindness, stringly typed code)172- Security (SQL injection, hardcoded credentials)173- Performance (N+1 queries, unbounded collections)174- Testing (duplication, testing implementation)175- Async (floating promises, callback hell)176177---178179## Languages Supported180181| Language | Extensions |182| ---------- | --------------------- |183| Python | `.py` |184| TypeScript | `.ts`, `.tsx` |185| JavaScript | `.js`, `.jsx`, `.mjs` |186| Go | `.go` |187| Swift | `.swift` |188| Kotlin | `.kt`, `.kts` |189190> **Creator:** Engineering Team191> **License:** MIT192> **Source Repo:** `neekware/dojo-skills`193> **Source Bucket:** `engineering-team`194> **Original Path:** `engineering-team/code-reviewer`