Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Kamila/set score game #226

Merged
merged 24 commits into from
May 3, 2022
Merged

Kamila/set score game #226

merged 24 commits into from
May 3, 2022

Conversation

kamilababayeva
Copy link
Collaborator

@kamilababayeva kamilababayeva commented Apr 30, 2022

This PR updates the score after each typing game ended based on genre/mode.

Changes:

  • mock typing game
  • add functions to set score per each genre in DataGetter
  • save mode/genre in GameManager

TODO next pr: save score per lyrics game, update UI

@kamilababayeva kamilababayeva self-assigned this May 1, 2022
@kamilababayeva kamilababayeva linked an issue May 1, 2022 that may be closed by this pull request
@kamilababayeva kamilababayeva marked this pull request as ready for review May 1, 2022 12:08
@jiabaow jiabaow self-requested a review May 1, 2022 15:00
Copy link
Collaborator

@jiabaow jiabaow left a comment

Choose a reason for hiding this comment

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

Thanks for this update!
As explained, test coverage is low because of the database which is not a problem, however, do you think it's worth it to refactor the duplicates?

app/src/main/java/ch/sdp/vibester/database/DataGetter.kt Outdated Show resolved Hide resolved
app/src/main/java/ch/sdp/vibester/database/DataGetter.kt Outdated Show resolved Hide resolved
app/src/main/java/ch/sdp/vibester/database/DataGetter.kt Outdated Show resolved Hide resolved
app/src/main/java/ch/sdp/vibester/database/DataGetter.kt Outdated Show resolved Hide resolved
dbUserRef.child(uid).child(fieldName)
.get().addOnSuccessListener { t ->
var finalVal = newVal
if(t.value != null) {
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think it is worth spending time refactoring these two duplicate functions?

@kamilababayeva kamilababayeva requested a review from jiabaow May 1, 2022 20:37
@MaximeZmt MaximeZmt self-requested a review May 2, 2022 11:21
Copy link
Owner

@MaximeZmt MaximeZmt left a comment

Choose a reason for hiding this comment

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

nice work 👍

Copy link
Owner

@MaximeZmt MaximeZmt left a comment

Choose a reason for hiding this comment

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

👍

@codeclimate
Copy link

codeclimate bot commented May 2, 2022

Code Climate has analyzed commit 71b39aa and detected 8 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 7

The test coverage on the diff in this pull request is 44.1% (80% is the threshold).

This pull request will bring the total coverage in the repository to 84.2% (0.1% change).

View more on Code Climate.

Copy link
Collaborator

@jiabaow jiabaow left a comment

Choose a reason for hiding this comment

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

lgtm

dbUserRef.child(uid).child(fieldName)
.get().addOnSuccessListener { t ->
var finalVal = newVal
if(t.value != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think it is worth spending time refactoring these two duplicate functions?

@kamilababayeva kamilababayeva merged commit de8f8a4 into main May 3, 2022
@kamilababayeva kamilababayeva deleted the kamila/set_score_game branch May 3, 2022 08:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save score in the firebase after the typing game ended
3 participants