---
title: "Code Quality"
description: "Reviews pull requests for duplication, conciseness, naming and typos, and code hygiene, with a strict bar for each check."
canonical: "https://baz.ai/docs/agents/build/code-quality"
---

# Code Quality

Reviews pull requests for duplication, conciseness, naming and typos, and code hygiene, with a strict bar for each check.

Code Quality reviews maintainability: code that duplicates an existing pattern, verbose constructs, misleading names, typos, and leftover clutter. It is tuned to avoid nitpicks. Each check has its own minimum bar, and suggestions follow the repository's existing style.

## What it catches

Code Quality points out code that will be harder to maintain than it needs to be: logic copied from a nearby file, code that is too long or deeply nested, confusing names and typos, and leftovers like commented-out code. It stays quiet on small changes, test code, and matters of taste such as short loop variable names or unused imports. When it finds repeats or typos, one comment lists every place to change.

Conciseness, naming, and hygiene judge only the added lines. Dedup compares against existing files.

## Why you can trust it

Code Quality findings go through the same independent check as Code Correctness, so you get a handful of concrete suggestions rather than a wall of nitpicks. Most findings are **Low** severity, and each one says exactly what to change. See [Verification protocol](/docs/concepts/verification-protocol).

## What you see

```markdown title="PR comment"
### Duplicates the pagination loop in `listInvoices`

`listCharges` repeats the cursor loop, page-size guard, and error mapping from
`billing/invoices.ts:88-120`. A change to the page size or retry rule would
need to be made in both places. Extract a `paginate(fetchPage)` helper in
`billing/pagination.ts` and call it from both.

[Code Quality · Severity: Low]
```

The Build row reads "Ensures that the code is clean, readable and consistent with your team's conventions."

## Prerequisites

None.

## Settings

Same controls as every Build agent: on/off switch, minimum severity, **Scope**, and **Reviewer memory**. Baz turns a Build agent off automatically when its acceptance rate in your organization falls below 25% after at least 10 findings. An agent you turn on yourself gets a 4-day grace period. See [Agent settings](/docs/agents/agent-settings).

## Related

<CardGroup cols={2}>
  <Card title="Code Correctness" href="/docs/agents/build/code-correctness" icon="bug">
    Behavior-changing defects.
  </Card>
  <Card title="AI Coding Guidelines" href="/docs/agents/build/ai-coding-guidelines" icon="file-code">
    Enforce conventions your team wrote down.
  </Card>
  <Card title="Agent settings" href="/docs/agents/agent-settings" icon="settings">
    Severity, scope, and auto-disable.
  </Card>
</CardGroup>
