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

Comment counter function fix #34

Closed
Yothu opened this issue Feb 3, 2022 · 1 comment · Fixed by #35
Closed

Comment counter function fix #34

Yothu opened this issue Feb 3, 2022 · 1 comment · Fixed by #35
Assignees
Labels
enhancement New feature or request

Comments

@Yothu
Copy link

Yothu commented Feb 3, 2022

Excellent and beautiful project guys! I only have one minor issue.

Issue

const commentCounter = (length) => {
if (length === undefined || length === null) return 0;
return length;
};

The name of the commentCounter function does do not reflect its functionality, because it gets from the very beginning the value that it is supposed to return, in this case, the length of the comment array. What it is actually doing is checking that the length of the comment array is valid.

Suggestion

To fix this issue I would recommend that in the commentCounter function put as a parameter the array of comments, and then return the length of the array.

@JohnFTitor
Copy link
Collaborator

Hi @Yothu

Thanks for your review. We're going to fix it right away!

@JohnFTitor JohnFTitor added this to To do in Code them all via automation Feb 3, 2022
@JohnFTitor JohnFTitor added the enhancement New feature or request label Feb 3, 2022
@JohnFTitor JohnFTitor moved this from To do to In progress in Code them all Feb 3, 2022
@JohnFTitor JohnFTitor moved this from In progress to Completed but not in Review in Code them all Feb 3, 2022
@JohnFTitor JohnFTitor moved this from Completed but not in Review to In review in Code them all Feb 3, 2022
@JohnFTitor JohnFTitor linked a pull request Feb 3, 2022 that will close this issue
@JohnFTitor JohnFTitor moved this from In review to Done in Code them all Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

3 participants