-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
private fun setupProfile(user: UserProfile){ | ||
findViewById<TextView>(R.id.handle).text = user.handle | ||
findViewById<TextView>(R.id.username).text = user.username | ||
findViewById<TextView>(R.id.totalGames).text = user.totalGames.toString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 4 locations. Consider refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has not been changed, because this is temporary for setting manually the values
findViewById<TextView>(R.id.handle).text = user.handle | ||
findViewById<TextView>(R.id.username).text = user.username | ||
findViewById<TextView>(R.id.totalGames).text = user.totalGames.toString() | ||
findViewById<TextView>(R.id.correctSongs).text = user.correctSongs.toString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 4 locations. Consider refactoring.
findViewById<TextView>(R.id.username).text = user.username | ||
findViewById<TextView>(R.id.totalGames).text = user.totalGames.toString() | ||
findViewById<TextView>(R.id.correctSongs).text = user.correctSongs.toString() | ||
findViewById<TextView>(R.id.bestScore).text = user.bestScore.toString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 4 locations. Consider refactoring.
findViewById<TextView>(R.id.totalGames).text = user.totalGames.toString() | ||
findViewById<TextView>(R.id.correctSongs).text = user.correctSongs.toString() | ||
findViewById<TextView>(R.id.bestScore).text = user.bestScore.toString() | ||
findViewById<TextView>(R.id.ranking).text = user.ranking.toString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 4 locations. Consider refactoring.
try { | ||
val list = Song.listSong(task.await()) | ||
for (x: Song in list) { | ||
if (mysong != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not duplication anymore, 2nd copy has been removed
mysong, | ||
mediaPlayer | ||
) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
genre/music/lyric temporary files have hardcoded strings, but can be changed on a different PR if necessary. Otherwise all good!
I didn't update it because it's a TemporaryFile. Thanks for review 👍 |
Since all of our tests are in Android Test, I would move ProfileDataProviderTest to Android Test folder. Also ProfileActivity is of different type than other files in activity folder, can you change that as well? I have attached the screenshot below. |
I didn't see the hidden test in the other folder, I will change that. Concerning the Profile Activity, I've seen that problem of type, but I don't know why, gonna try again The global coverage is going down by 0.2 because I've removed temporary files that were well tested. I've tried to improve one or two test, but the global tradeoff is still of 0.2 |
Code Climate has analyzed commit 8c8c726 and detected 7 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 91.4% (80% is the threshold). This pull request will bring the total coverage in the repository to 94.5% (0.0% change). View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for refactoring! The code looks much nicer!
Refactor
This is related to issue #88
This Pull Requests contains:
Deletion of the GreetingsActivity (was created during bootcamp)
Create a Logo for the app (still a draft)
Choose a color palette
ReDesign from the welcome screen
Refactor the whole directory of the app, changes names of file with a better name
Has fixed 13 of 20 Maintainability issues
Improve readability of TypingGame (could still be improved)
removed MusicTemporary (not needed anymore)
Optimize imports for all app files
In addition the code is tested with a coverage of: [91.4]%
Notes for reviewers