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

refactor createAPIService #126

Merged
merged 4 commits into from
Mar 31, 2022
Merged

refactor createAPIService #126

merged 4 commits into from
Mar 31, 2022

Conversation

jiabaow
Copy link
Collaborator

@jiabaow jiabaow commented Mar 31, 2022

  • refactor API service builder
  • refactor Lastfm method
  • reformat code in all files (based on android studio suggestions) [sorry guys, I should have done this in a separate PR...]

@jiabaow jiabaow marked this pull request as draft March 31, 2022 13:56
@@ -53,28 +50,29 @@ class GenreTemporary : AppCompatActivity() {
startActivity(newIntent)
}

// view is needed, remove it will result failure in tests
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 5 locations. Consider refactoring.

Copy link
Collaborator Author

@jiabaow jiabaow Mar 31, 2022

Choose a reason for hiding this comment

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

function call with different parameters, cannot really refactor

@jiabaow jiabaow linked an issue Mar 31, 2022 that may be closed by this pull request
3 tasks
@jiabaow jiabaow self-assigned this Mar 31, 2022
@jiabaow jiabaow marked this pull request as ready for review March 31, 2022 14:58
}

fun playBillieEilish(view: View){
performQuery(LastfmUri(method = BY_ARTIST, artist = "Billie Eilish"))
fun playBillieEilish(view: View) {
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 5 locations. Consider refactoring.

@@ -26,7 +26,7 @@ import kotlin.random.Random
*/
@RunWith(AndroidJUnit4::class)
class AuthenticationActivityTest {
private val SLEEP_TIME: Long = 5000
private val sleepTime: Long = 5000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we use camel case for all the constants from now on?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will say yes but only when they are inside a class

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.

Good job on refactoring everything, the code feels much more legible! 👍

@codeclimate
Copy link

codeclimate bot commented Mar 31, 2022

Code Climate has analyzed commit 6a15331 and detected 6 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 5

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

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

View more on Code Climate.

Copy link
Collaborator

@laurislopata laurislopata left a comment

Choose a reason for hiding this comment

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

Don't have much to add. The code looks better after refactoring. LGTM

Copy link
Collaborator

@Tsathogguaa Tsathogguaa left a comment

Choose a reason for hiding this comment

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

Great work! Thanks for the refactoring!

@jiabaow jiabaow merged commit ffee551 into main Mar 31, 2022
@jiabaow jiabaow deleted the jwen/refactor-const branch March 31, 2022 15:29
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.

Refactor API service
4 participants