laravel-code-quality / references/review-output.md

Review output

Read when: reporting the findings of a code review, by hand or from a reviewer agent. Owns: the report template, ordering, tone, and the definition of each severity.

TL;DR

  • Cite file:line for every finding.
  • Pair each problem with the corrected code.
  • Security and boundaries first; formatting last or not at all (Pint owns it).
  • Mark each finding ๐Ÿ”ด, ๐ŸŸก or ๐ŸŸข as defined below. Cite the anti-pattern number when one matches.
  • Omit empty sections. Say plainly when a change is solid.

Severity

Flag Meaning In review Typical findings
๐Ÿ”ด Critical must fix before merge block security holes, broken module boundaries, partial writes (no transaction), once-only work that can run twice, response-contract regressions
๐ŸŸก Warning should fix; debt if left fix in this change if reasonable, otherwise a follow-up raw arrays for DTOs, logic in a controller, missing eager loads, comments that restate code
๐ŸŸข Suggestion optional recommend; do not block naming, small refactors the author may defer

Template

## Review

### Files reviewed
- `src/Domain/Billing/Actions/IssueRefund.php`
- `app/Http/Controllers/RefundController.php`

### Verdict
โœ… Approve  /  โš ๏ธ Approve with suggestions  /  โŒ Changes required

### Security
- ๐Ÿ”ด `routes/web.php:88` โ€” export route outside the auth group (#53).

### Boundaries and layers
- ๐Ÿ”ด `RefundService.php:42` โ€” query in a Service (#5). Move it to `GetPendingRefunds` and delegate.

### Data and queries
- ๐ŸŸก `RefundController.php:31` โ€” `$request->all() + [...]` lets the request override `customer_id` (#32).

### API and responses
- ๐Ÿ”ด `RefundController.php:57` โ€” `store` returns 200 (#69); return 201 with the resource.

### Code quality
- ๐ŸŸก `IssueRefund.php:12` โ€” comment restates the next line (#49); delete it.

### Suggestions
- ๐ŸŸข โ€ฆ

### Seen nearby (not blocking)
- Older problems in files the change touched, one line each.

### What is good
- Specific, not generic ("the transition guard covers self-approval and has a test for it").

### Summary
Files: 2 ยท ๐Ÿ”ด 3 ยท ๐ŸŸก 2 ยท ๐ŸŸข 1

How to write findings

  • One finding per problem, with the offending line and the fix side by side when it is not obvious.
  • Lead with what can break production or leak data, then boundary violations, then the rest.
  • Suggest the fix; do not only name the smell.
  • Point to the anti-pattern number instead of re-explaining it.
  • Keep it short. A balanced review gets read; a wall of nits gets ignored.
  • Scope findings to what the change touched. Pre-existing problems go under "Seen nearby", not in the blocking list.
  • Do not flag a decision the project documented as a deliberate deviation.