---
title: "lint/complexity/no-unused-label"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="lint/complexity/no-unused-label" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Report only. Upstream gates: `bleedingEdge (featureToggles.unusedLabel)`.

## What it does

Detects redundant `goto` labels that are declared but not used.

## Configuration

```toml title="pun.toml"
[lint.rules]
"complexity/no-unused-label" = "error"
```

To skip it in some files or lines, add an [override](/docs/configuration/pun-toml#lint) or an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`UnusedLabelRule`](https://phpstan.org/error-identifiers/label.unused) (phpstan-classes)
- [`no-redundant-label`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#no-redundant-label) (mago-linter)
- [`label.unused`](https://phpstan.org/error-identifiers/label.unused) (phpstan)

[More lint/complexity rules](/docs/rules/lint/complexity) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
