Skip to content

harrie7: Code Review 2#24

Open
feroxi-s wants to merge 5 commits into
masterfrom
harrie7_codereview_2
Open

harrie7: Code Review 2#24
feroxi-s wants to merge 5 commits into
masterfrom
harrie7_codereview_2

Conversation

@feroxi-s
Copy link
Copy Markdown

No description provided.

@feroxi-s
Copy link
Copy Markdown
Author

The tests still fail, but are now failing in the same way they did in the most recent commit to master.

@feroxi-s
Copy link
Copy Markdown
Author

ANALYSIS:
The program was available in Github on time.
The program does compile.
I'm not sure I follow the exact reasoning for some of the ways the program is written. I imagine the IncidentDTO class is used for mapping the API data to FreeWays' own Incident class, for example, but I gathered that on my own and not from the documentation.

Technical concepts:
I understood more clearly how layouts and previews work in Kotlin, including some new UI elements I hadn't seen before.
I gained a better understanding of user-specific directories and how to write to them.
I learned a little more about scoped functions in Kotlin.

Button(
onClick = {
var incidentInfo = Incident().apply {
var incidentInfo = Incident("1").apply {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's the meaning of the "1" here? It looks like a magic number. Make a constant from this, and give the constant a descriptive name, so that the code is self-describing.

snapshot?.let {
val allIncidents = ArrayList<Incident>()
allIncidents.add(Incident(caseId = NEW_INCIDENT))
allIncidents.add(Incident(incidentId = "1", caseId = NEW_INCIDENT))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this needed?

Comment on lines -75 to +77
handle.addOnFailureListener { Log.e("Firebase", "Save failed $it") }
handle.addOnFailureListener { Log.e("Firebase", "Save failed $user") }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These are different variables:
it == the error message
user == a user

I'd keep this as it were, as the error message is the most important thing to see in a log.

Comment on lines -85 to +87
handle.addOnFailureListener { Log.e("Firebase", "User save failed $it") }
handle.addOnFailureListener { Log.e("Firebase", "User save failed $user") }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ditto above.


data class Incident(
var incidentId: String = "",
var incidentId: String,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does this reduce technical debt?

@discospiff
Copy link
Copy Markdown

I don't see enough technical debt reduction in this branch to warrant a merge.

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.

2 participants