Skip to content

Fix frontend SonarQube findings: SRI, ReDoS, contrast, missing labels - #11

Merged
RuslanLomaka merged 1 commit into
masterfrom
fix/frontend-sonarqube-issues
Aug 29, 2026
Merged

Fix frontend SonarQube findings: SRI, ReDoS, contrast, missing labels#11
RuslanLomaka merged 1 commit into
masterfrom
fix/frontend-sonarqube-issues

Conversation

@RuslanLomaka

Copy link
Copy Markdown
Owner
  • Add integrity/crossorigin to all cdnjs CodeMirror /<script> tags across sandbox.html, problem.html, and longest-unique-substring.html
  • Remove duplicate head-loaded codemirror.min.js in longest-unique-substring.html
  • Fix superlinear regex backtracking in sandbox.js variable-name pattern
  • Darken run-tests-button colors in problem.css to meet WCAG AA contrast
  • Add sr-only labels for the code/solution textareas to fix missing associated label accessibility warnings
  1. Empty

    — "heading has no text reachable by a screen reader" (problem.html:50)
    False positive. The scanner reads the raw template statically and doesn't evaluate Thymeleaf — th:text injects the real title text into the

    at server render time, so the actual HTML sent to the browser always has content. No real
    accessibility gap exists. (Could optionally add Thymeleaf's natural-templating fallback text, e.g.

    Problem Title

    , later — decided not to for now.)

  2. xmlns:th="http://www.thymeleaf.org" — "URI is not registered" (8 files: fragments/navbar.html, problems.html, problems-algorithms.html, problems-collections.html, problems-arrays.html, sandbox.html, problem.html,
    collections/longest-unique-substring.html)
    Not a real defect. This is IntelliJ's own XML-namespace inspection trying to resolve the xmlns value against a schema/DTD. Thymeleaf's namespace URI is just an identifier so th:* attributes are recognized — it isn't a fetchable schema
    location, so there's nothing to validate and no functional impact.

  3. "Missed locally stored library for HTTP link" (sandbox.html:22, sandbox.html:74 — CodeMirror show-hint CSS/JS)
    IDE convenience suggestion only (offers to cache a local copy for autocomplete). No effect on runtime behavior, security, or code quality.

  4. "Unresolved function or method showHint()" (sandbox.js:234, weak warning)
    False positive. showHint() is attached to the CodeMirror editor instance at runtime by the separately-loaded show-hint addon script, so the static analyzer can't resolve it statically — it works correctly in the browser.

- Add integrity/crossorigin to all cdnjs CodeMirror <link>/<script> tags
  across sandbox.html, problem.html, and longest-unique-substring.html
- Remove duplicate head-loaded codemirror.min.js in longest-unique-substring.html
- Fix superlinear regex backtracking in sandbox.js variable-name pattern
- Darken run-tests-button colors in problem.css to meet WCAG AA contrast
- Add sr-only labels for the code/solution textareas to fix missing
  associated label accessibility warnings
@sonarqubecloud

Copy link
Copy Markdown

@RuslanLomaka
RuslanLomaka merged commit 2f05b46 into master Aug 29, 2026
3 of 4 checks passed
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