---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.2
alternate:
  - https://sourcecraft.dev/portal/docs/en/cli-ref/src-appsec-defect.md
  - https://sourcecraft.dev/portal/docs/ru/cli-ref/src-appsec-defect.md
  - https://sourcecraft.dev/portal/docs/ru/cli-ref/src-appsec-defect.md
  - href: https://sourcecraft.dev/portal/docs/ru/cli-ref/src-appsec-defect.md
    type: text/markdown
    title: Markdown version
  - href: https://sourcecraft.dev/portal/docs/ru/llms.txt?revision=r22161526
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/ru/llms.txt?revision=r22161526

# src appsec defect

Show a defect group by the number the UI displays.

The statuses the group can move to are part of what is shown, and they are what
'src appsec defect set-status' accepts.

When code-flow traces are available, the card shows a hint. Add --trace to show
their steps below the card. Use --json with --trace for full code and messages.

## Usage

`src appsec defect [<id>] [flags]`

### Available commands

| Command | Description |
| --- | --- |
| [comment](src-appsec-defect-comment.md) | Show the comments of a defect group, and write them |
| [list](src-appsec-defect-list.md) | List the defect groups of the latest scan |
| [set-status](src-appsec-defect-set-status.md) | Triage one or more defect groups |
| [trace](src-appsec-defect-trace.md) | Show the SAST code-flow traces of a defect group |

### Examples

**Show defect group #42**

`src appsec defect 42`

**The number may be written as it is shown in the UI**

`src appsec defect '#42'`

**List them instead**

`src appsec defect list`

**Follow the SAST code-flow traces for #42**

`src appsec defect 42 --trace`

**Include full traces for up to 100 findings in JSON**

`src appsec defect 42 --trace --limit 100 --json`

**Read what happened to #42: comments, status changes, AI events**

`src appsec defect comment 42`

### Flags

| Flag | Description |
| --- | --- |
| `-L, --limit int` | Maximum number of findings with traces (with --trace) (default "30") |
| `--trace` | Show code-flow traces below the defect details |

### Inherited flags

| Flag | Description |
| --- | --- |
| `--env string` | Override Sourcecraft environment (use 'src envs' to list available) |
| `--json string` | Output JSON, optionally filtered (--json or --json=field1,field2) |
| `--json-compact string` | Output compact JSON, optionally filtered |
| `-R, --repo string` | Select another repository using OWNER/REPO format |
| `-V, --verbose` | Enable debug logging output |

### Learn more

Use `src appsec defect <subcommand> --help` for more information about a command.
