Skip to content

Feedback & Code Review od Mentora Recenzenta (Jan Owsiany) #103

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

Open
wants to merge 301 commits into
base: feedback/mentor-recenzent
Choose a base branch
from

Conversation

Nefariusek
Copy link
Owner

No description provided.

@Nefariusek Nefariusek changed the title Feedback & Code Review od Mentora Recenzenta (Mateusz Ossoliński) Feedback & Code Review od Mentora Recenzenta (Jan Owsiany) Jan 5, 2022
Copy link

@janowsiany janowsiany left a comment

Choose a reason for hiding this comment

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

Unfortunately, I couldn't go through everything deeply, I focused on JavaScript part and just looked briefly on CSS
The general comment is i like when the project uses a consistent naming convention, i did not find it here 😅
On the other congrats on linking it all together, i see a huge effort here 🍝, as for the first project the scope of it is impressive 👏
Also, the code in multiple places had great quality and looked very professionally 🎖️

Comment on lines 12 to 13
const factJson = await factResponse.json();
const imgJson = await imgResponse.json();

Choose a reason for hiding this comment

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

Suggested change
const factJson = await factResponse.json();
const imgJson = await imgResponse.json();
const [factJson, imgJson] = await Promise.all([factResponse.json(), imgResponse.json()]);

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok

Comment on lines 14 to 18
const factResult = {
fact: factJson.text,
imageUrl: imgJson[0].url,
};
return factResult;

Choose a reason for hiding this comment

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

Suggested change
const factResult = {
fact: factJson.text,
imageUrl: imgJson[0].url,
};
return factResult;
return {
fact: factJson.text,
imageUrl: imgJson[0].url,
};

i like to skip variable declaration if it is used only for return

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok

Comment on lines 3 to 4
const randomNumber = randomIntFromInterval(0, animalTypes.length - 1);
const randomAnimalType = animalTypes[randomNumber];

Choose a reason for hiding this comment

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

Suggested change
const randomNumber = randomIntFromInterval(0, animalTypes.length - 1);
const randomAnimalType = animalTypes[randomNumber];
const randomInt = randomIntFromInterval(0, animalTypes.length - 1);
const randomAnimalType = animalTypes[randomInt];

when there is a name in getter function then i like to have the corresponding name for variable, using consistent vocabulary is IMHO important

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok

Comment on lines 5 to 8
const questionsApis = {
DOGS: { url: 'https://api.thedogapi.com/v1/breeds', api_key: '62b8cc9a-2c13-4eec-abe2-80703eabb0a6' },
CATS: { url: 'https://api.thecatapi.com/v1/breeds', api_key: '2d4cf1ee-1883-474f-80ab-f931262fd79b' },
};

Choose a reason for hiding this comment

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

i do not like mixing cases and naming conventions for variables

Copy link
Collaborator

Choose a reason for hiding this comment

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

changed

Comment on lines 6 to 7
DOGS: { url: 'https://api.thedogapi.com/v1/breeds', api_key: '62b8cc9a-2c13-4eec-abe2-80703eabb0a6' },
CATS: { url: 'https://api.thecatapi.com/v1/breeds', api_key: '2d4cf1ee-1883-474f-80ab-f931262fd79b' },

Choose a reason for hiding this comment

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

I think it is important to tell the team that putting api_key in git repositories is antipattern and should never happen

Copy link
Collaborator

Choose a reason for hiding this comment

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

moved to .env

clearInterval(timer);
}

function timerDigits(time_value) {

Choose a reason for hiding this comment

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

inconsistent variable naming time_value

Copy link
Collaborator

Choose a reason for hiding this comment

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

changed to timeValue

import '../../style.css';
import Button from '../../components/Button/Button';

class QuizSettings {

Choose a reason for hiding this comment

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

to be honest i do not like the way it is implemented with static methods, seems overengineered for me

}, 1000);
}

export function stopTimer() {

Choose a reason for hiding this comment

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

It is not used

Copy link
Collaborator

Choose a reason for hiding this comment

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

removed

Comment on lines 141 to 142
const time = timerMinutes * 60 + timerSeconds;
return time;

Choose a reason for hiding this comment

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

Suggested change
const time = timerMinutes * 60 + timerSeconds;
return time;
return timerMinutes * 60 + timerSeconds;

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok

Comment on lines 139 to 140
timerMinutes = document.getElementById('timer-minutes').innerText;
timerSeconds = document.getElementById('timer-seconds').innerText;

Choose a reason for hiding this comment

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

I do not like that the state(minutes and seconds) is shared through HTML element 😞

Copy link
Collaborator

Choose a reason for hiding this comment

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

used export/import instead

@Urszuja
Copy link
Collaborator

Urszuja commented May 25, 2022

changes introduced.

@Nefariusek Nefariusek requested a review from Urszuja May 25, 2022 18:42
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.

7 participants