Skip to content

Fix for Useless assignment to local variable#2172

Merged
rkaraivanov merged 1 commit intomasterfrom
finding-autofix-bea8df2a
Apr 1, 2026
Merged

Fix for Useless assignment to local variable#2172
rkaraivanov merged 1 commit intomasterfrom
finding-autofix-bea8df2a

Conversation

@rkaraivanov
Copy link
Copy Markdown
Member

In general, unused local-variable assignments should either be removed or the variable should be used meaningfully. Here, the test first uses barSize for the horizontal orientation and then reassigns barSize for the vertical orientation but never uses the second value. To fix this without changing existing functionality, remove the unnecessary assignment but still keep any side effect if needed (in this case, there is no side effect we rely on, so simply dropping the assignment is safe).

Concretely, in src/components/splitter/splitter.spec.ts, at the block starting around line 880 where splitter.orientation = 'vertical'; is set, replace the line barSize = bar.getBoundingClientRect().height; with just a call to bar.getBoundingClientRect().height; or remove the line entirely. Since the return value is not needed, the simplest and cleanest fix is to delete the line. No additional imports, methods, or definitions are needed.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@rkaraivanov rkaraivanov marked this pull request as ready for review April 1, 2026 08:04
@rkaraivanov rkaraivanov merged commit c4f31ed into master Apr 1, 2026
7 checks passed
@rkaraivanov rkaraivanov deleted the finding-autofix-bea8df2a branch April 1, 2026 08:11
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