diff --git a/CHANGELOG.md b/CHANGELOG.md index bf8ec7c268..08b85d7300 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Improved nested ternary by using early return (Sonarqube S3358) + ## 3.65.0 - 2026-08-31 ### Added diff --git a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts index b50f89a8eb..9a215ee5b3 100644 --- a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts +++ b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts @@ -397,11 +397,13 @@ export class GfPortfolioProportionChartComponent context.dataIndex ] as string; - return value > 0 - ? isUUID(symbol) - ? (this.data[symbol]?.name ?? symbol) - : symbol - : ''; + if (value <= 0) { + return ''; + } + + return isUUID(symbol) + ? (this.data[symbol]?.name ?? symbol) + : symbol; }, offset: 8 }