Passa al contenuto principale

Z303-duplicate-def — DUPLICATE_DEF

Z-Code: Z303 DUPLICATE_DEF · Engine: standalone · Exit: 0

zenzic check all
standalone - 1 file (1 docs, 0 assets) - 0.0s - 65 files/s
docs/index.md:15
[Z303]Reference ID '[api]' is defined more than once.
First definition wins (CommonMark §4.7).
13│ The new [API][api] includes a breaking change in `/v2/auth`.
14
15[api]: https://api-v1.example.com
16│ [api]: https://api-v2.example.com
17│ <!-- The `api` reference ID is defined twice above — once for v1,
once for v2.
────────────────────────────────────────────────────────────────────────────────
Summary:✘ 0 errors⚠ 1 warningsℹ 0 info- 1 file with findings
* Analysis complete: All statically-detectable links, credentials, and
references verified.
Refer to https://zenzic.dev/docs/reference/finding-codes for remediation · Try
'zenzic check --help' for options.
[ Suppression Audit: 1/30 (inline: 0, per-file: 1) [MANAGED DEBT]
exit 0

Il Fixture

Il fixture si trova in examples/z303-duplicate-def/ nel repository Zenzic. Contiene documenti che dimostrano la violazione Z303.

Eseguire l'Esempio

# Clona il repository Zenzic — nessuna installazione aggiuntiva richiesta
cd examples/z303-duplicate-def
uvx zenzic check all

Expected output:

standalone - 1 file (1 docs, 0 assets) - 0.0s - 66 files/s

docs/index.md:15 ! [Z303] Reference ID '[api]' is defined more than once.
First definition wins (CommonMark §4.7).

13 │ The new [API][api] includes a breaking change in `/v2/auth`.
14 │
15 ❱ [api]: https://api-v1.example.com
16 │ [api]: https://api-v2.example.com
17 │ <!-- The `api` reference ID is defined twice above — once for v1,
once for v2.

────────────────────────────────────────────────────────────────────────────────

Summary: x 0 errors ! 1 warning i 0 info - 1 file with findings

* Analysis complete: All statically-detectable links, credentials, and
references verified.
Refer to https://zenzic.dev/docs/reference/finding-codes for remediation · Try
'zenzic check --help' for options.
[ Suppression Audit: 1/30 (inline: 0, per-file: 1) [MANAGED DEBT]

Exit code: 0

Interpretare l'Output

Il codice di errore Z303 indica un problema di tipo DUPLICATE_DEF.

Questo errore o avviso viene generato da Zenzic quando un identificatore di riferimento è definito più di una volta nello stesso file. In base alle specifiche CommonMark (§4.7), solo la prima definizione è attiva, mentre i duplicati successivi vengono ignorati. In questo esempio specifico:

  • Tipo di Scansione: Reference Scanner
  • Severità: Warning
  • Impatto: Le definizioni duplicate indicano incongruenze strutturali e comportano una detrazione DQS di 3.0 punti.

Correggere la Violazione

Risolvi il problema come riportato da Zenzic.

Vedi Anche