Skip to content

Spauldingv code review1#8

Open
spauldvl wants to merge 14 commits intomainfrom
spauldingv_codeReview1
Open

Spauldingv code review1#8
spauldvl wants to merge 14 commits intomainfrom
spauldingv_codeReview1

Conversation

@spauldvl
Copy link
Copy Markdown
Collaborator

@spauldvl spauldvl commented Mar 5, 2023

This is a workout logging app designed to be able to track your own workouts and find workouts from the JSON data. The user can also make groups for workouts as well.
Yes, submitted on time.
Yes, the program is well documented. There are comments explaining pretty much what each function and class does.
The unit tests did not compile for me. I'm not sure if it was because of my computer or I was looking at the wrong branch or something.

What I learned:
Using scaffold for navigation
I can have different UI features in different files and implement them into MainActivity
Different UI features like Box and different modifiers for Text to make UI better

Comment thread app/build.gradle
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

had to change version for retrofit2 to work

}

}
@Preview(name="Light Mode", showBackground=true)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added preview so emulator would not need to be reran

}
}

@Preview(showBackground = true)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this line was redlining and didn't work to show preview



@Preview(name="Light Mode", showBackground=true)
@Preview(uiMode= Configuration.UI_MODE_NIGHT_YES, showBackground = true, name="Dark Mode")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

refactored to make preview work

@@ -0,0 +1,21 @@
package com.example.workoutapp
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added missing RetrofitClientInstance file. Implementing this and DAO and DTO packaged should help make unit tests run.


object RetrofitClientInstance {
private var retrofit: Retrofit? = null
private val BASE_URL = ""
Copy link
Copy Markdown
Collaborator Author

@spauldvl spauldvl Mar 5, 2023

Choose a reason for hiding this comment

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

add your own base URL from your JSON link (boilerplate code)


}
}
@Preview(name="Light Mode", showBackground=true)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added another preview

@@ -0,0 +1,6 @@
package com.example.workoutapp.service
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

need to implement WorkoutService with fetchWorkouts function to parse JSON data

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This appears to be an incomplete feature, as there's not a BASE_URL. Recommendation: if not used, remove it, or keep it in a separate development branch until it is complete.

Keep the codebase as small as possible to do the job you want to do. Unused code is clutter, and bad documentation, which increases technical debt.

Only complete features, which meet the team's Definition of Done, should be merged to Main/Master.


@Test
fun `Given a dto when name is Barbell Curl, and level is beginner`() {
var workout = Workout("Barbell Curl", "pull", "beginner", "isolation", "barbell", "biceps", "forearms",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

need to implement Workout class

@@ -0,0 +1,167 @@
package com.example.workoutapp
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

these unit tests failed for me because of lack to implement necessary classes for it

import retrofit2.http.GET

interface IWorkoutDAO {
@GET("")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

put your own json link here

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This appears to be an incomplete feature, as there's not a BASE_URL. Recommendation: if not used, remove it, or keep it in a separate development branch until it is complete.

Keep the codebase as small as possible to do the job you want to do. Unused code is clutter, and bad documentation, which increases technical debt.

Only complete features, which meet the team's Definition of Done, should be merged to Main/Master.

@@ -0,0 +1,5 @@
package com.example.workoutapp.dto

class Workout {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I couldn't find your json link anywhere to come up with the workout class myself

@discospiff
Copy link
Copy Markdown

Some good suggestions here, though I wouldn't recommend merging this branch at this time.

  1. For the project group, all work should be merged to main before code review. Reviewing separate branches, without a holistic view of the application, is of limited benefit, in this case.
  2. This branch introduces new, and sometimes incomplete, functionality. New functionality is better in a separate branch until fully developed, as features should not be merged to main/master until the meet the team's Definition of Done. Code review branches should minimize technical debt, and thus, be merge-able to master immediately. So, if the team desires these features, I'd keep the branch open, and iterate over the feature until it is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants