OWASP/Nest

Ternary operators should not be nested

Offen

#4.582 geöffnet am 25.04.2026

 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (651 Forks)auto 404
good first issue

Repository-Metriken

Stars
 (412 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 2T 12h) (128 gemergte PRs in 30 T)

Beschreibung

Description

SonarCloud reports a violation of rule typescript:S3358 , Ternary operators should not be nested. So Extract nested ternary operation into an independent statement.

Sonar Issue

https://sonarcloud.io/project/issues?open=AZzuG_Gt93q8aLTr6ODJ&id=OWASP_Nest

Affected Code

       const displayVal = typeof val === 'number' ? val : Array.isArray(val) ? val[0] : val

Contributor Guide