Skip to content

fix: resolve CodeQL alerts #24 and #26#4145

Merged
khassel merged 2 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO:fix/codeql
May 6, 2026
Merged

fix: resolve CodeQL alerts #24 and #26#4145
khassel merged 2 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO:fix/codeql

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator

#24js/class.js

fnTest works by serialising a function to a string and checking if "xyz" appears in it - the function is never actually called. The bare xyz; is never executed, so CodeQL is right to flag it. return xyz; makes the intent clear. So this is purely a cosmetic change.

#26tests/e2e/helpers/global-setup.js

CodeQL flagged if (exec) exec; as a useless expression - and it was right. But the real find was one level deeper.

startApplication hardcoded const port = 8080, so MM_PORT was always overwritten before the app started. The test named "Set port 8100 on environment variable MM_PORT" was actually testing port 8080 the whole time - it just happened to pass anyway.

Removed the dead exec parameter, made startApplication read MM_PORT from the environment, and fixed the test so it actually checks what it says it checks.

…eQL #26)

startApplication hardcoded port 8080, so the "MM_PORT override" test
was actually testing port 8080 all along and passing for the wrong reason.
Also removes the dead exec callback that masked the issue.
@khassel khassel merged commit 9386c44 into MagicMirrorOrg:develop May 6, 2026
12 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.

2 participants