Skip to content

fix(apps): resolve CodeQL static analysis warnings across codebase#1557

Open
ArtieReus wants to merge 17 commits intomainfrom
artie-fix-more-codeql-findings
Open

fix(apps): resolve CodeQL static analysis warnings across codebase#1557
ArtieReus wants to merge 17 commits intomainfrom
artie-fix-more-codeql-findings

Conversation

@ArtieReus
Copy link
Collaborator

@ArtieReus ArtieReus commented Mar 20, 2026

Summary

Resolves all CodeQL static analysis warnings to improve code quality, reliability, and maintainability. These fixes address potential bugs, redundant code, and anti-patterns detected by automated code scanning.

Changes by Category

Malformed HTML Attributes (3 fixes)

  • Toast.test.tsx, Message.test.tsx, ComboBox.test.tsx: Fixed malformed id attributes containing spaces
    • Changed "My shiny little Message""my-shiny-little-message"
    • Changed "My Id""my-id"
    • HTML IDs must not contain whitespace per W3C standards

Comparison Between Inconvertible Types (2 fixes)

  • Highlighter.tsx: Fixed boolean comparison error
    • Changed (!mutation.type === "childList")(mutation.type !== "childList")
    • Original condition always evaluated to false due to comparing boolean to string
  • createFiltersSlice.tsx: Added explicit array type check
    • Added Array.isArray() check to properly validate object types

Useless Conditional (2 fixes)

  • filterViolations.ts: Removed redundant boolean AND operation
    • Changed found = found && ...found = ... (found was always true)
  • AlertStatus.tsx: Fixed redundant null check
    • Changed {alert && ...}{alert?.status?.state && ...} after early return
    • Prevents rendering empty span elements

Expression Has No Effect (2 fixes)

  • ClusterEdit.tsx: Removed useless property access clusterInEdit?.spec
    • Line was evaluating property but not using the result
  • createSilencesSlice.tsx: Fixed zustand set() call syntax
    • Changed comma operator (set(...), false) → proper function call set(..., false)

Duplicate Property (1 fix)

  • teams/lib/store.ts: Removed duplicate namespace property
    • Property was declared twice in object literal (copy-paste error)

Missing Variable Declaration (1 fix)

  • helpers.ts: Added missing let declaration for errMsg variable
    • Variable was becoming a global without declaration, causing potential bugs

Useless Assignment to Local Variable (1 fix)

  • OptionInput.tsx: Removed unused object variable in JSON validation
    • Function only validates JSON syntax, doesn't need parsed result

Related Issues

  • Code quality findings from CodeQL

Testing Instructions

  1. pnpm i
  2. pnpm run test

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

@ArtieReus ArtieReus requested review from a team and franzheidl as code owners March 20, 2026 11:37
@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2026

🦋 Changeset detected

Latest commit: 4759643

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@cloudoperators/juno-ui-components Patch
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-doop Patch
@cloudoperators/juno-app-carbon Patch
@cloudoperators/juno-app-example Patch
@cloudoperators/juno-app-heureka Patch
@cloudoperators/juno-app-template Patch
@cloudoperators/juno-messages-provider Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ArtieReus ArtieReus self-assigned this Mar 20, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

PR Preview Action v1.8.1

🚀 View preview at
https://cloudoperators.github.io/juno/pr-preview/pr-1557/

Built to branch gh-pages at 2026-03-23 08:36 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

2 participants