-
Notifications
You must be signed in to change notification settings - Fork 0
Kamila/game manger online #364
base: main
Are you sure you want to change the base?
Conversation
val searchByTag = LastfmMethod.BY_TAG.method | ||
val searchByArtist = LastfmMethod.BY_ARTIST.method | ||
|
||
kpop.setOnClickListener { chooseGenre(method = searchByTag, tag = "kpop", mode = R.string.kpop) } |
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.
val searchByArtist = LastfmMethod.BY_ARTIST.method | ||
|
||
kpop.setOnClickListener { chooseGenre(method = searchByTag, tag = "kpop", mode = R.string.kpop) } | ||
rock.setOnClickListener { chooseGenre(method = searchByTag, tag = "rock", mode = R.string.rock) } |
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.
|
||
kpop.setOnClickListener { chooseGenre(method = searchByTag, tag = "kpop", mode = R.string.kpop) } | ||
rock.setOnClickListener { chooseGenre(method = searchByTag, tag = "rock", mode = R.string.rock) } | ||
bts.setOnClickListener { chooseGenre(method = searchByArtist, artist = "BTS", mode = R.string.gameGenre_bts) } |
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.
rock.setOnClickListener { chooseGenre(method = searchByTag, tag = "rock", mode = R.string.rock) } | ||
bts.setOnClickListener { chooseGenre(method = searchByArtist, artist = "BTS", mode = R.string.gameGenre_bts) } | ||
topTracks.setOnClickListener { chooseGenre(method = LastfmMethod.BY_CHART.method, mode = R.string.top_tracks) } | ||
imagDragons.setOnClickListener{ chooseGenre(method = searchByArtist, artist = "Imagine Dragons", mode = R.string.gameGenre_imagine_dragons) } |
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.
bts.setOnClickListener { chooseGenre(method = searchByArtist, artist = "BTS", mode = R.string.gameGenre_bts) } | ||
topTracks.setOnClickListener { chooseGenre(method = LastfmMethod.BY_CHART.method, mode = R.string.top_tracks) } | ||
imagDragons.setOnClickListener{ chooseGenre(method = searchByArtist, artist = "Imagine Dragons", mode = R.string.gameGenre_imagine_dragons) } | ||
billieEilish.setOnClickListener { chooseGenre(method = searchByArtist, artist = "Billie Eilish", mode = R.string.gameGenre_billie_eilish) } |
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.
validate.setOnClickListener{ chooseGenreByArtist(searchArtistEditable.toString(), R.string.gameGenre_byArtistSearch) } | ||
} | ||
|
||
private fun chooseGenreByTag(tag: String, mode: Int) { |
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.
chooseGenre(method = LastfmMethod.BY_TAG.method, tag = tag, mode = mode) | ||
} | ||
|
||
private fun chooseGenreByArtist(artist: String, mode: Int) { |
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.
queryRooms.addValueEventListener(object : ValueEventListener { | ||
override fun onDataChange(dataSnapshot: DataSnapshot) { | ||
for (score in dataSnapshot.children) { | ||
val email = (score.value as HashMap<String, Object>)["first"] as String |
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.
override fun onDataChange(dataSnapshot: DataSnapshot) { | ||
for (score in dataSnapshot.children) { | ||
val email = (score.value as HashMap<String, Object>)["first"] as String | ||
val gameScore = ((score.value as HashMap<String, Object>)["second"] as Long).toInt() |
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.
val billieEilish = vmGenreSetup.view.findViewById<Button>(R.id.billieEilishButton) | ||
val validate = vmGenreSetup.view.findViewById<Button>(R.id.validateSearch) | ||
|
||
kpop.setOnClickListener { chooseGenre(tag = "kpop", mode = R.string.kpop) } |
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.
val validate = vmGenreSetup.view.findViewById<Button>(R.id.validateSearch) | ||
|
||
kpop.setOnClickListener { chooseGenre(tag = "kpop", mode = R.string.kpop) } | ||
rock.setOnClickListener { chooseGenre(tag = "rock", mode = R.string.rock) } |
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.
|
||
kpop.setOnClickListener { chooseGenre(tag = "kpop", mode = R.string.kpop) } | ||
rock.setOnClickListener { chooseGenre(tag = "rock", mode = R.string.rock) } | ||
bts.setOnClickListener { chooseGenre(artist = "BTS", mode = R.string.gameGenre_bts) } |
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.
rock.setOnClickListener { chooseGenre(tag = "rock", mode = R.string.rock) } | ||
bts.setOnClickListener { chooseGenre(artist = "BTS", mode = R.string.gameGenre_bts) } | ||
topTracks.setOnClickListener { chooseGenre(mode = R.string.top_tracks) } | ||
imagDragons.setOnClickListener{ chooseGenre(artist = "Imagine Dragons", mode = R.string.gameGenre_imagine_dragons) } |
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.
bts.setOnClickListener { chooseGenre(artist = "BTS", mode = R.string.gameGenre_bts) } | ||
topTracks.setOnClickListener { chooseGenre(mode = R.string.top_tracks) } | ||
imagDragons.setOnClickListener{ chooseGenre(artist = "Imagine Dragons", mode = R.string.gameGenre_imagine_dragons) } | ||
billieEilish.setOnClickListener { chooseGenre(artist = "Billie Eilish", mode = R.string.gameGenre_billie_eilish) } |
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.
👍
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.
It might be accepted by the CI one day
setGenreListeners() | ||
|
||
val bundle = this.arguments | ||
if (bundle != 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.
Identical blocks of code found in 2 locations. Consider refactoring.
vmChooseRoom.view = view | ||
vmChooseRoom.ctx = view.context | ||
val bundle = this.arguments | ||
if (bundle != 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.
Identical blocks of code found in 2 locations. Consider refactoring.
setGameSongList(uri, playOffline) | ||
|
||
val bundle = bundleOf("gameManager" to gameManager) | ||
if(!test) { |
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.
|
||
createPartyRoom.setOnClickListener { | ||
val bundle = bundleOf("gameManager" to gameManager) | ||
if(!test){ |
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.
|
||
private fun setReturnBtnListener() { | ||
vmGenreSetup.view.findViewById<FloatingActionButton>(R.id.genreSetup_returnToMain).setOnClickListener { | ||
if(!test) { |
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.
Identical blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit 3fc67c4 and detected 11 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 0.0% (80% is the threshold). This pull request will bring the total coverage in the repository to 0.0% (-84.4% change). View more on Code Climate. |
No description provided.