Skip to content

Clean up CodeQL js/ warnings in commons UI#298

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fix/js-codeql-cleanups
Jul 23, 2026
Merged

Clean up CodeQL js/ warnings in commons UI#298
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fix/js-codeql-cleanups

Conversation

@vharseko

Copy link
Copy Markdown
Member

Summary

Resolves five CodeQL js/ code-scanning alerts in first-party UI code. All changes are behavior-preserving cleanups of dead/redundant code.

Alert Rule Fix
#2072 js/comparison-between-incompatible-types ViewManager.js — drop redundant cDialog !== null next to the truthiness check
#2070 js/duplicate-html-attribute LoginTemplate.html — remove duplicated type="checkbox" on the loginRemember input
#2068 js/useless-assignment-to-local Messages.js — drop unused initial alert-info value; the switch (with its default) always overwrites alertClass
#2053 js/regex/duplicate-in-character-class UIUtils.js — remove the repeated ! in the isUrl regex character class
#2046 js/trivial-conditional UserProfileKBATab.js — simplify the always-true inner isKbaQuestion term in the KBA guard

Note

The remaining open js/ alerts are all inside commons/rest/openapi-war-overlay/ (vendored handlebars/marked/swagger-oauth) and are addressed by removing that module in a separate branch, so they are intentionally not touched here.

Resolve five CodeQL js/ alerts in first-party UI code (no behavior change):

- ViewManager.js: drop redundant 'cDialog !== null' next to the truthiness
  check (js/comparison-between-incompatible-types).
- LoginTemplate.html: remove the duplicated type="checkbox" attribute on the
  loginRemember input (js/duplicate-html-attribute).
- Messages.js: drop the unused initial 'alert-info' value of alertClass, which
  the switch (including its default branch) always overwrites
  (js/useless-assignment-to-local).
- UIUtils.js: remove the repeated '!' from the isUrl regex character class
  (js/regex/duplicate-in-character-class).
- UserProfileKBATab.js: simplify the always-true inner 'isKbaQuestion' term
  in the KBA validation guard (js/trivial-conditional).
@vharseko
vharseko requested a review from maximthomas July 23, 2026 05:21
@vharseko vharseko added codeql CodeQL static-analysis findings refactoring Code cleanup / refactoring, no behavior change labels Jul 23, 2026
@vharseko
vharseko merged commit b19d0ab into OpenIdentityPlatform:master Jul 23, 2026
14 checks passed
@vharseko
vharseko deleted the fix/js-codeql-cleanups branch July 23, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codeql CodeQL static-analysis findings refactoring Code cleanup / refactoring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants