bounswe / bounswe2015group8

WeStory: Share your story. Make your own cultural history.
3 stars 1 forks source link

Code Review Request #302

Closed gokcantali closed 8 years ago

gokcantali commented 8 years ago

Please perform a code review on the commit 2e1fd92b7a022a75721c1813a6f5e955c8ec52f3 before this midnight.

dorukkilitcioglu commented 8 years ago

Code Clarity:

Code is perfectly readable, there are no issues with clarity.

Bugs:

Session is opened but never closed in /TagDaoImpl.java at getTagsByContext(String) method. Note that this is a repository wide situation that some opened sessions are not closed. They will need to be checked and debugged. The reason some of them are done this way is due to the way Hibernate's lazy-loading works. Large scale debugging is necessary to deal with this problem.

Missing Features:

There are no features that were supposed to be done in this commit that are not done. There are numerous stuff that have been added later in the history of the search branch that either bugfix or complement what was done in this commit. Perhaps this would be a better question if a code review is done on a seperate branch through a pull request.

Coding Conventions:

Incomplete Code Documentation:

None of the methods and classes are properly documented. SearchController class has a basic template but it is not in a valid (Doxygen) format and is not very informative.

Coverage with unit tests:

There are no unit tests for any of the methods. Most of them are untestable since they are session related and their output will change as the database changes. What we can do, however, is add range checks (Ex: Integer.MAXVALUE and Integer.MINVALUE) to those methods that return an integer. They will still need the database to be functional to work, but at least there won't be any overflows.

Code Modification:

Code can be modified easily. For example, I can easily change the minimum amount of posts returned by SearchController's searchByTag(String) method and get more posts returned when searching by a tag.

Construct style:

Classes are all compliant with Hibernate's, Spring's, and Java's guidelines. Methods are small and modular.

Code Analysis Tools:

On running IntelliJ Code Analyzer on the methods associated with the commit, I have seen that there are no significant suggestions given by the analyzer.

Overall, this is one of the cleanest and issue free commits I've ever seen. Great job, @gokcantali , and don't forget to be awesome.

gokcantali commented 8 years ago

Thank you for the amazing review @Xyllan !

As you suggested, I implemented some unit tests and added the doxygen documentation to necessary places. You can check the following commits: 6f636ebd1c4cbe5019ab45b42f41985b72bffcaa , 7a4dd81b3ebb7f6efdf3d5f2a86e98ee19ab65ed, 52f48f6dd78d2784cfd4c2995c879e7c045f8f55

Please check whether these commits fulfill the requirements which were missing the last time. And keep being awesome!

dorukkilitcioglu commented 8 years ago

Many unit tests are implemented and newly added functions are commented. Nice job!