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

kamila/user_profile #51

Merged
merged 40 commits into from
Mar 11, 2022
Merged

kamila/user_profile #51

merged 40 commits into from
Mar 11, 2022

Conversation

kamilababayeva
Copy link
Collaborator

Basic layout for the profile. The display of user image functionality is disabled for the time being.

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()
Copy link

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.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()
Copy link

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()
Copy link

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()
Copy link

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.

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!
It would be even better if you manage to remove the duplications, but these are optional ;)

btnGreeting.setOnClickListener {
greetingIntent.putExtra("name", txtInput.text.toString())
startActivity(greetingIntent)
btnGreeting.setOnClickListener {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will the indentations be too much here?

Copy link
Collaborator

@zwierski zwierski left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@codeclimate
Copy link

codeclimate bot commented Mar 11, 2022

Code Climate has analyzed commit d53c95b and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 4

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

This pull request will bring the total coverage in the repository to 96.0% (-3.4% change).

View more on Code Climate.

@MaximeZmt MaximeZmt merged commit 1c3cb84 into main Mar 11, 2022
@MaximeZmt MaximeZmt deleted the kamila/user-profile branch March 11, 2022 08:15
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.

4 participants