-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
|
||
} | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { |
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 onCreate
has 59 lines of code (exceeds 25 allowed). Consider refactoring.
return newIntent | ||
} | ||
|
||
fun guess(song: Song, guessLayout: LinearLayout, ctx: Context, playedSong: Song, player: CompletableFuture<MediaPlayer>?): FrameLayout{ |
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 guess
has 5 arguments (exceeds 4 allowed). Consider refactoring.
|
||
} | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { |
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 onCreate
has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring.
} | ||
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.
for(x: Song in list){ | ||
if (mysong != null) { | ||
guess(x, findViewById<LinearLayout>(R.id.displayGuess), this@TypingGame, 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.
As you said some refactoring is needed but we can focus on that next week, other than that LGTM
Code Climate has analyzed commit e5b6945 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 89.9% (80% is the threshold). This pull request will bring the total coverage in the repository to 91.9%. 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.
👍
@@ -25,8 +25,8 @@ class ItunesMusicApi private constructor(){ | |||
* @param baseUrl (Optional) If you want to specify an other url to query | |||
* @return CompletableFuture<String> that contains the result of the query | |||
*/ | |||
fun querySong(query: String, okHttp: OkHttpClient, baseUrl: String = LOOKUP_URL_BASE): CompletableFuture<String> { | |||
val buildedUrl = baseUrl+query.replace(' ', '+') | |||
fun querySong(query: String, okHttp: OkHttpClient, limit: Int, baseUrl: String = LOOKUP_URL_BASE): CompletableFuture<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.
Don't forget to update the documentation for limit
Typing Game
This is related to issue #64
This Pull Requests contains:
ch.sdp.vibester.api: BitmapGetterApi: an api with a function download(...) that will return a CompletableFuture of a Bitmap
ch.sdp.vibester.games: TypingGame: An activity that represent a game where the user has to type to guess a music
In addition the code is tested with a coverage of: [89]%
Notes for reviewers