-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reformat / Refactor of states in the discover Viewmodel #275
Conversation
…ng the DiscoverScreenVM to use less parameters and improve the coverage in the future Still needs to be tested
… be checked deeply
…t the rest seems fine
Quality Gate passedIssues Measures |
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.
LGTM
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.
You did some amazing changes! Maybe not so visually appealing but truly useful for everyone. Your coverage is not above 80% on new code but since you are using the map I guess it isn't testable. Everything else is tested Overall really good job. Keep it up :)
The issue
Previously, all the states and functions of the discoverscreen viewmodel were given as parameters to the screens using them. This made the code hard to read and maintain and had a negative impact on the general line coverage of the project. (Because the navgraph is almost untestable, adding lines there to initiate screens wasn't beneficial for us)
The solution
I fixed this for the discovery screen viewmodel by creating two data classes, one that stores all the states and one that stores all the functions called by screens. This took a lot of time to merge with main since a lot of PRs changed completely the content of certain files.
Tests
I tested as much as it was possible, but Sonar has a weird way of qualifying what is "new code". It counted in my additions a lot of part that I didn't really modify (the map screen) that blocks my line coverage at around 73. There is, for the moment, no possible ways to test this composable and since I did not change anything about it's functionalities, it should be fine and there is not much that I can do.
Additionaly, the modification I did improved the global line coverage of the project by 3%, which was already higher than 80% before.
Next
We should do that for all the viewmodel, but this time is really time consuming and comports some risks when merging