-
-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve CodeQL query alert 56 #5473
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Hi @ajb176, thank you for taking up this issue! Hfla appreciates you :) Do let fellow developers know about your:- You're awesome! P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :) |
ETA: One week |
The code should be updated. Firstly, the same returnless function also occurs in the right-col-content.js file in the same directory, which is importing the same script from ./utility, so this and issue #6479 should be dealt with the same way. Because the issue has already been assigned, I'll just try to coordinate with them. What seems to be happening is addEventListener is meant to take a function reference with no parameters as an argument, but because a function called InsertEventSchedule with parameters is called, the script immediately runs the function to try to pass its return value as the parameter to addEventListener. The code is meant to wait until the DOM content is loaded before firing a callback function, but because the callback function isn't formatted correctly, it fires before the condition is necessarily met. In other words, the function tries to populate the event schedule before the DOM content is loaded, despite clearly being designed to wait for the DOM content to load before populating the event schedule. When I visit HFLA live pages that use the script, they seem to work fine because adding the event schedule just takes more time and the DOM content loads quickly anyway. But the code can be re-factored to fix the CodeQL issue easily by using either an arrow function or an anonymous function. |
Prerequisite
Overview
We need to analyze the query "Use of returnless function" which appears in the CodeQL code alert 56 then either recommend dismissal of the alert or update code to resolve the alert.
Action Items
dismiss as test
,dismiss as false positive
,dismiss as won't fix
, orupdate code
.Questions/In Review
and apply the labelready for dev lead
.For merge team/dev lead
Resources/Instructions
The text was updated successfully, but these errors were encountered: