Skip to content
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

Code review #112

Closed
16 of 18 tasks
lrollet1 opened this issue May 13, 2022 · 0 comments
Closed
16 of 18 tasks

Code review #112

lrollet1 opened this issue May 13, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@lrollet1
Copy link
Collaborator

lrollet1 commented May 13, 2022

RockPaperScissors

Overall good job! The structure of your code is easy to understand and the use of Mockito helps a lot with your testing. There is however a concerning lack of documentation and you should work on it ASAP. Furthermore, the code style is not consistent and lots of part would heavily benefit from spacing.

We found the following comments:

Your Repository is too bloated. Functionalities such as users, friends, games, statistics, ... could be split into different repositories to make the codebase easier to manage and re-use.

All of your public functions should be documented (except maybe the really obvious ones). This principle applies especially to the interfaces and abstractions. Most of your code is not documented at all and it heavily hinders its comprehension.

There is a problem with the code organization within your files and classes. Functions, variables and objects are mixed together randomly. Try to apply the following guideline: constants first, then fields/properties, then companion objects, then functions and event listeners. An example is the OfflineGameService.kt file.

Your code is hard to read because you don't follow common layout principles. We see a lot of comments with no spacing after the //, some spaces missing before/after brackets or types, ... Don't forget that Android Studio has an automatic code formatter that you should run on the project before you commit. It is present everywhere, but a perfect example is the Cache.kt file.

You have a tendency to drop extremely dense chunks of code in your functions without any spacing or dinstinction between the lines. Even inside a same function adding spacing between different parts of the code helps. An example is the TicTacToeGame.kt file.

Some of your tests don't have explicit names. The test name should describe the functionality tested.

We are not sure what your LogService is used for.

Use it to log.

Your model package seems a bit heavy, you could split your model files in different subpackages (e.g. user, friend, game, ...)

Make sure that your app doesn't crash when offline. For example the Leaderboard crashes the app when in airplane mode.

You shoudn't hard-code strings in your code, use strings.xml instead.

Check the warnings in Android Studio (Code > Inspect code...), you don't need to fix everything but there are a lot of easy things to fix. There are also a lot of warnings by the Android linter here: https://github.com/SDP-Rock-Paper-Scissors/RockPaperScissors/runs/6319295076

  • Some false positives like typos, but important.
@gaetschwartz gaetschwartz added the enhancement New feature or request label May 26, 2022
@gaetschwartz gaetschwartz pinned this issue May 26, 2022
@gaetschwartz gaetschwartz closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants