# Doctor

Check your project for common code health issues and fix them.

**Doctor** reads the React code of your project and lists problems that make it buggy, slow, hard to use or hard to maintain. It gives your code a health score, explains each problem, and can hand the list to the AI to fix.

The Doctor tab in DevTools before a first run, with Run Doctor and what gets checked: security, performance, maintainability, bugs, accessibility and complexity.

## What you can do

- Analyze your React code in one click.
- See a health score and how it changed since the last run.
- Read problems grouped by category, file or severity.
- See what was found and how to fix it.
- Send one problem, or all of them, to the AI.

## Run Doctor

1. ### Open Doctor

   Open **DevTools** from the bottom bar of the editor and choose the **Doctor** tab.
2. ### Run it

   Choose **Run Doctor**. Doctor scans the files in your project and shows its progress.
3. ### Read the result

   The score reads **Great**, **Needs work** or **Critical**, with the change since the last run. Problems are sorted into six categories: **Security**, **Bugs**, **Performance**, **Accessibility**, **Maintainability** and **Complexity**.

Choose **Run again** after you or the AI change the code.

## Read and fix problems

- **Group by** **Category**, **File** or **Severity**. Filter with **Filter problems**, or by severity in **All severities**, which also offers **Only the most severe**. On accessibility problems, **RGAA theme** filters by the themes of the French accessibility criteria.
- Select a problem to see **What was found** and **How to fix**, and, for accessibility, the **RGAA criteria** it touches. Choose **Open file** to go to the line, or copy the path or the rule id.
- **Fix with agent** on a problem asks the AI to fix it, and **Send to chat** adds it to your message.
- In **More actions**, **Fix with agent** or **Send all to AI** hands every problem to the AI, and **Show passing checks** lists the checks that found nothing.

> [!WARNING]
>
> **Doctor is not a security scan**
>
> Doctor's Security category covers a few risky React patterns only. It does not check your secrets, database or packages. Run the [Security scan](/features/test-and-debug/security-scan) too.

## Shortcuts

| Action           | Shortcut     |
| ---------------- | ------------ |
| Next problem     | `F2`         |
| Previous problem | `Shift + F2` |

## FAQ

### Doctor could not run

Doctor runs in your sandbox. Wait for the project to finish loading, then choose **Try again**.

### How is Doctor different from Problems?

[Problems](/features/test-and-debug/problems) lists type errors, lint warnings and build errors: code that breaks. Doctor looks for code that works but could be better.

## Related

- [Security scan](/features/test-and-debug/security-scan): Find vulnerabilities before you publish.
- [Problems](/features/test-and-debug/problems): Type errors, lint warnings and build errors.
- [DevTools](/features/test-and-debug/devtools): Every debugging tool in one panel.
