Gemini 3.5 Flash vs Grok 4.5 for code review

The verdict

Grok 4.5 wins, 8884

Same 12 code review tasks, marked blind by three rival labs. Grok 4.5 took 6 tasks, Gemini 3.5 Flash took 1, 5 tied. Tested 18 Aug 2026.

Where they differed most

The task — Three things wrong in six lines

Review this Express route. `db.query` returns a Promise resolving to an array of rows. app.get('/api/orders', async (req, res) => { const status = req.query.status; const rows = db.query( `SELECT id, customer, total FROM orders WHERE status = '${status}' ORDER BY created_at DESC` ); res.json({ orders: rows, count: rows.length }); }); Find the defects and rank them by severity. For the most serious one, give a concrete example of an input that exploits it and say what it would do. For the second, say exactly what the caller receives today and why nothing in the logs would show a problem. Then give the corrected route.

Here is the review of the Express route, ranking the defects by severity, explaining their behavior, and providing the corrected code.

---

### Defect 1: SQL Injection (Severity: High)

#### Description
The route directly interpolates the `status` query parameter into the SQL string using template literals (`'${status}'`). This allows untrusted user input to alter the structure of the SQL command executed by the database.

#### Example Exploit Input
An attacker could supply the following value for the `status` parameter in the query string:
``…
## Defects (by severity)

### 1. **Critical — SQL injection**
`status` is concatenated into the SQL string. An attacker controls the query.

**Exploit example:**  
`GET /api/orders?status='%20OR%20'1'='1`

That yields:
```sql
SELECT id, customer, total FROM orders WHERE status = '' OR '1'='1' ORDER BY created_at DESC
```
→ returns **every order**.  
Worse payloads can read other tables, modify data, or drop tables (depending on DB privileges), e.g.  
`status='; DROP TABLE orders; --`

---

### 2. **High — missing `await` on a Promise**
`db.quer…

Task by task

TaskGemini 3.5 FlashGrok 4.5
The pagination that skips page one88
Nothing wrong with it88
Three things wrong in six lines89
Two customers, one last item910
Rank by what breaks88
The review, as JSON88
Slow is not the same as wrong89
Overdue at one in the morning89
Write only the comment1010
The complaint that is not a defect89
Right, and unusable98
Refuse the rubber stamp910

Full receipts: Gemini 3.5 Flash, Grok 4.5 · judges claude-sonnet-5, gpt-5.6-terra, grok-4.5

Questions people ask

Which is better for code review: Gemini 3.5 Flash or Grok 4.5?

Grok 4.5 — it scored 88/100 against 84/100 on our 12-task code review suite, winning 6 tasks to 1 with 5 tied. Every answer was marked blind by three judges from three rival AI labs.

How was this tested?

Both models answered the identical published code review tasks. Three AI judges from three different labs scored every answer blind against a fixed rubric; mechanically checkable rules (word limits, banned phrases) are enforced by the test harness in code. The raw outputs and judge verdicts are downloadable.

More code review head-to-heads: GPT-5.6 Sol vs Grok 4.5 · Gemini 3.5 Flash vs GPT-5.6 Sol · GPT-5.5 vs Grok 4.5 · Gemini 3.5 Flash vs GPT-5.5 · Claude Sonnet 5 vs Grok 4.5 · Claude Sonnet 5 vs Gemini 3.5 Flash

Full ranking: Best AI for code review · model pages: Gemini 3.5 Flash, Grok 4.5