OWASP/Nest

Ternary operators should not be nested

开放

#4,582 创建于 2026年4月25日

 (3 条评论) (0 个反应) (0 位负责人)Python (651 个派生)auto 404
good first issue

仓库指标

星标
 (412 个星标)
PR 合并指标
 (平均合并 2天 12小时) (30 天内合并 128 个 PR)

描述

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

贡献者指南