Skip to content

refactor: replace if/else with classList.toggle and .toggleAttribute …#7682

Open
ykolo-glu wants to merge 1 commit intojellyfin:masterfrom
ykolo-glu:dashboard-livetvtuner-onTypeChange-ifElseToToggle
Open

refactor: replace if/else with classList.toggle and .toggleAttribute …#7682
ykolo-glu wants to merge 1 commit intojellyfin:masterfrom
ykolo-glu:dashboard-livetvtuner-onTypeChange-ifElseToToggle

Conversation

@ykolo-glu
Copy link

Codesmell Removal in onTypeChange

Changes
Replace if/else blocks with classList.toggle for hiding/showing elements
Replace setAttribute/removeAttribute with toggleAttribute for required fields
Fix typo: suppportsSubmit → supportsSubmit

Issues
Fixes cognitive complexity issue in onTypeChange (livetvtuner.js):
https://sonarcloud.io/project/issues?impactSeverities=HIGH&issueStatuses=OPEN%2CCONFIRMED&types=CODE_SMELL&id=jellyfin_jellyfin-web&open=AXepJq0ZYTlMEX6vFIKi

@ykolo-glu ykolo-glu requested a review from a team as a code owner March 13, 2026 17:35
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant