Skip to content
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

Remove unused variable to resolve CodeQL Alert issue #114 #7295

Closed
2 tasks done
pluto-bell opened this issue Aug 15, 2024 · 3 comments
Closed
2 tasks done

Remove unused variable to resolve CodeQL Alert issue #114 #7295

pluto-bell opened this issue Aug 15, 2024 · 3 comments
Assignees
Labels
Complexity: Small Take this type of issues after the successful merge of your second good first issue Draft Issue is still in the process of being created Feature: Code Alerts Ignore: Duplicate Issue or pull request is a duplicate milestone: missing role: front end Tasks for front end developers size: 0.5pt Can be done in 3 hours or less

Comments

@pluto-bell
Copy link
Member

pluto-bell commented Aug 15, 2024

Overview

To remove an unused variable, thus cleaning up the code to make it more readable.

Action Items

The resolution of this issue will close #7013 and resolve alert 114

  • Remove unused variable weekday in the function getDayString in right-col-content.js.
Details on what to remove

Update getDayString function from

function getDayString(date) {
    let new_date = new Date(date); 
    let weekday = new_date.getDay();
    let options = { weekday: "long" };
    return new Intl.DateTimeFormat("en-US", options).format(new_date);
  }

to

function getDayString(date) {
    let new_date = new Date(date); 
    let options = { weekday: "long" };
    return new Intl.DateTimeFormat("en-US", options).format(new_date);
  }

  • Test using docker to ensure this change doesn't affect anything else—specifically the events page.

Resources/Instructions

For further information you can review issue #7013

Note: this exact function is also found in api-events.js, without the weekday variable.

api-events.js — line 119
Screenshot 2024-08-15 at 11 36 05 AM
@pluto-bell pluto-bell added role: front end Tasks for front end developers Complexity: Small Take this type of issues after the successful merge of your second good first issue size: 0.5pt Can be done in 3 hours or less Draft Issue is still in the process of being created Feature: Code Alerts labels Aug 15, 2024
@pluto-bell pluto-bell self-assigned this Aug 15, 2024
@HackforLABot
Copy link
Contributor

Hi @pluto-bell, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:-
i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?)
ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

@pluto-bell pluto-bell moved this from New Issue Approval to In progress (actively working) in P: HfLA Website: Project Board Aug 15, 2024
@github-project-automation github-project-automation bot moved this from In progress (actively working) to QA in P: HfLA Website: Project Board Aug 18, 2024
@pluto-bell pluto-bell closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2024
@pluto-bell
Copy link
Member Author

Misunderstood issue #7013's instructions so I am closing this issue, as it is technically a duplicate of it.

@kgold2018
Copy link
Member

closed as duplicated

@kgold2018 kgold2018 added the Ignore: Duplicate Issue or pull request is a duplicate label Oct 12, 2024
@kgold2018 kgold2018 moved this from QA to Done in P: HfLA Website: Project Board Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Small Take this type of issues after the successful merge of your second good first issue Draft Issue is still in the process of being created Feature: Code Alerts Ignore: Duplicate Issue or pull request is a duplicate milestone: missing role: front end Tasks for front end developers size: 0.5pt Can be done in 3 hours or less
Projects
Development

No branches or pull requests

4 participants