-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
} | ||
} | ||
|
||
private fun setNextButtonListener(ctx: Context, gameManager: GameManager) { |
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.
|
||
fun testClearResult() { | ||
clearResult() | ||
fun testGetAndCheckLyrics(ctx: Context, songName: String, artistName: String, speechInput: String, gameManager: GameManager) { |
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.
Method testGetAndCheckLyrics
has 5 arguments (exceeds 4 allowed). Consider refactoring.
*/ | ||
private fun getAndCheckLyrics(songName: String, artistName: String, speechInput: String, gameManager: GameManager) { | ||
private fun getAndCheckLyrics(ctx: Context, songName: String, artistName: String, speechInput: String, gameManager: GameManager) { |
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.
Method getAndCheckLyrics
has 5 arguments (exceeds 4 allowed). 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.
nice work 👍 Potential quick thing to modify commented. What do you think ?
return !gameManager.checkGameStatus() || !gameManager.setNextSong() | ||
} | ||
|
||
fun superTestProgressBar(myBar: ProgressBar, progressTime: Int=0){ |
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.
Line 106 is not fully tested. Idk if it can be easy to test it ?
if (hasWon) { | ||
Toast.makeText(ctx, "$score Well Done!", Toast.LENGTH_SHORT).show() | ||
} else { | ||
Toast.makeText(ctx, "Sadly you're wrong", Toast.LENGTH_SHORT).show() |
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.
Also here we should use string.xml
*/ | ||
private fun hasWon(ctx: Context, score: Int, hasWon: Boolean) { | ||
if (hasWon) { | ||
Toast.makeText(ctx, "$score Well Done!", Toast.LENGTH_SHORT).show() |
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.
We may use String.xml instead of hardcoding
} else { | ||
findViewById<TextView>(R.id.lyricMatchResult).text = | ||
"No lyrics found, try another song" | ||
Toast.makeText(ctx, "No lyrics found, try the next song", Toast.LENGTH_SHORT).show() |
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.
May use string.xml file
…en/enhance-lyric-game
startRound(ctx, gameManager) | ||
} | ||
} | ||
|
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 urgent, but maybe refactor these two functions into one "set listeners of buttons" function.
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 work! Some minor refactoring to do but it's not urgent.
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.
👍
Code Climate has analyzed commit e98abab 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 96.4% (80% is the threshold). This pull request will bring the total coverage in the repository to 88.6% (0.6% change). View more on Code Climate. |
What is done in this PR: