Skip to content

Fix for Useless assignment to local variable#1

Merged
johnsamuelwrites merged 1 commit intomainfrom
finding-autofix-c6641011
Apr 21, 2026
Merged

Fix for Useless assignment to local variable#1
johnsamuelwrites merged 1 commit intomainfrom
finding-autofix-c6641011

Conversation

@johnsamuelwrites
Copy link
Copy Markdown
Member

General fix: remove dead initializations and declare variables without assigning a value until a value is actually needed, or limit scope to branches where values are produced.

Best fix here (without changing behavior): in assets/ui.js, inside the keydown handler in initTabs(), change let nextIndex = index; to let nextIndex;. This preserves existing control flow and all tab navigation behavior while removing the no-effect write that CodeQL flags.

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>
@johnsamuelwrites johnsamuelwrites marked this pull request as ready for review April 21, 2026 18:16
@johnsamuelwrites johnsamuelwrites merged commit 0cca609 into main Apr 21, 2026
8 checks passed
@johnsamuelwrites johnsamuelwrites deleted the finding-autofix-c6641011 branch April 21, 2026 18:16
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