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

Implement Codacy Recommendations #113

Merged
merged 5 commits into from
Dec 15, 2023
Merged

Conversation

confused-Techie
Copy link
Member

Alright, apologies to @DeeDeeG for the fact I just don't seem to stop making PPM PRs lol.

This PR should be the last one of the ones I've had semi ready to go, and implements the majority of the low hanging fruit flagged on codacy.

Thanks again to anyone able to review this one, and hopefully I'll calm down in this repo afterwards

Copy link
Member

@DeeDeeG DeeDeeG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 👍 .

Tests pass.

Diff looks good.

if (response.statusCode == 404) {
if (response.statusCode === 404) {
Copy link
Member

@DeeDeeG DeeDeeG Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFORMATIONAL (NO ACTION NEEDED):

"For fun" (out of curiosity), I checked that the statusCode is in fact a number, and not a string, when the URL is wrong. (I deliberately edited the hard-coded target URL to be wrong, logged the typeof response.statusCode here, and I got:

typeof response.statusCode is: number

Script behaves as expected with === 404 as opposed to === "404" which bugs out.

Overly thorough way of saying this change is good 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton for double checking! My intuition in this space said they should be numbers and I didn't question it. So I'm happy you've actually checked

@DeeDeeG
Copy link
Member

DeeDeeG commented Dec 15, 2023

I'm surprised how many unused require()s there are in this repo. Must have been a fair amount of churn throughout development.

@DeeDeeG
Copy link
Member

DeeDeeG commented Dec 15, 2023

Alright, apologies to @DeeDeeG for the fact I just don't seem to stop making PPM PRs lol.

Lol, no worries. I happen to be available to review these at the moment. Good to see some, er, winter cleaning around this repo, heh.

@confused-Techie
Copy link
Member Author

Thanks for the review @DeeDeeG!

And yeah it's surprising how much junk is left over in this repo, so I'm more than happy to just delete it lol

@confused-Techie confused-Techie merged commit 228ccc3 into master Dec 15, 2023
11 checks passed
@confused-Techie confused-Techie deleted the codacy-recommendations branch December 15, 2023 23:49
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