-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
R.id.rockButton-> {method = LastfmMethod.BY_TAG.method; tag = "rock"; mode = "rock" } | ||
R.id.topTracksButton -> {method = LastfmMethod.BY_CHART.method; mode = "top tracks"} | ||
R.id.billieEilishButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "Billie Eilish"; mode = "billie eilish"} | ||
R.id.btsButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "BTS"; mode = R.string.bts.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 5 locations. Consider refactoring.
R.id.topTracksButton -> {method = LastfmMethod.BY_CHART.method; mode = "top tracks"} | ||
R.id.billieEilishButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "Billie Eilish"; mode = "billie eilish"} | ||
R.id.btsButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "BTS"; mode = R.string.bts.toString() } | ||
R.id.kpopButton -> {method = LastfmMethod.BY_TAG.method; tag = "kpop"; mode = R.string.kpop.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 5 locations. Consider refactoring.
R.id.billieEilishButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "Billie Eilish"; mode = "billie eilish"} | ||
R.id.btsButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "BTS"; mode = R.string.bts.toString() } | ||
R.id.kpopButton -> {method = LastfmMethod.BY_TAG.method; tag = "kpop"; mode = R.string.kpop.toString() } | ||
R.id.imagDragonsButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "Imagine Dragons"; mode = R.string.imagine_dragons.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 5 locations. Consider refactoring.
R.id.btsButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "BTS"; mode = R.string.bts.toString() } | ||
R.id.kpopButton -> {method = LastfmMethod.BY_TAG.method; tag = "kpop"; mode = R.string.kpop.toString() } | ||
R.id.imagDragonsButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "Imagine Dragons"; mode = R.string.imagine_dragons.toString()} | ||
R.id.rockButton-> {method = LastfmMethod.BY_TAG.method; tag = "rock"; mode = R.string.rock.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 5 locations. Consider refactoring.
R.id.imagDragonsButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "Imagine Dragons"; mode = R.string.imagine_dragons.toString()} | ||
R.id.rockButton-> {method = LastfmMethod.BY_TAG.method; tag = "rock"; mode = R.string.rock.toString() } | ||
R.id.topTracksButton -> {method = LastfmMethod.BY_CHART.method; mode = R.string.top_tracks.toString()} | ||
R.id.billieEilishButton -> {method = LastfmMethod.BY_ARTIST.method; artist = "Billie Eilish"; mode = R.string.billie_eilish.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 5 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.
Would it be possible to refactor these lines in, for example, a function that takes the "method" and the "mode" as parameters and the artist/tag as an optional String parameter? It's not urgent but it could solve the detected duplication.
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.
I will keep this in mind when we do the general refactoring.
Code Climate has analyzed commit d50f08b and detected 5 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 93.9% (80% is the threshold). This pull request will bring the total coverage in the repository to 82.1% (0.2% 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 the changes! I have left minor comment, but it looks good to me!
R.id.imagDragonsButton -> {sortedBy += R.string.imagine_dragons; genre = "Imagine Dragons"} | ||
R.id.billieEilishButton -> {sortedBy += R.string.billie_eilish; genre = "Billie Eilish"} | ||
R.id.rockButton -> {sortedBy += R.string.rock; genre = "rock"} | ||
R.id.topTracksButton -> {sortedBy += R.string.top_tracks; genre = "top tracks"} |
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.
Should we put genre into the strings as well?
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.
I tried but that doesn't work, I explained in the comment in line 39.
Co-authored-by: kamilababayeva <[email protected]>
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.
Very good changes! I left a question about the duplication issue but it's not something that needs to be changed urgently.
retrieve actual data from firebase to each scoreboard per genre, and sort them by descending order.