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

Miscellanous issues arising during code review #9

Open
anjackson opened this issue Jul 17, 2017 · 4 comments
Open

Miscellanous issues arising during code review #9

anjackson opened this issue Jul 17, 2017 · 4 comments
Assignees

Comments

@anjackson
Copy link
Contributor

anjackson commented Jul 17, 2017

One of a set of questions that arose during an internal code review.

Some minor issues that arose in general:

  • Code has very little logging
  • Code has no tests
  • Code has very few comments, making large code blocks difficult to understand. A bit more vertical spacing and some comments about what the major sections were doing would be good.

in the Java:

  • Can we use server-relative URLs throughout? Rather that needing the replace-with-https code and other manipulations involving absolute URLs?
  • There are quite a lot of hard-coded 'magic numbers/strings' that should really be declared in static properties. e.g. here
  • Hard-coded per-facet logic means adding a new facet is relatively cumbersome.
  • Almost no JavaDoc - it would be useful to have some on major public API components.
  • Often uses a 'passing mutable state' approach when an 'immutable state management' style would be cleaner. e.g. here

in the templates:

  • there seems to be a lot of repeated HTML fragments, e.g. per facet, that would be better done as sub-templates (e.g. this also makes adding a new facet cumbersome)
  • there seems to be rather a lot of programmatic logic in the JSPs that might be better done in helper methods or ameliorated by more re-use of template code/sub-templates.

and in the JavaScript:

@anjackson
Copy link
Contributor Author

Assigning this to you @ldbiz to see if I missed anything important. See also #5 #6 #7 #8

@bzaar
Copy link
Contributor

bzaar commented Jul 18, 2017

Hi Andy, thank you for highlighting those issues. I will split out some of them so they are easier to manage and track. E.g. I've just split out #12 for logging.

@anjackson
Copy link
Contributor Author

anjackson commented Jul 18, 2017

No worries, and just to be clear, we're not expecting you to address all these things at this stage in the game. Or even agree with them all. They are just issues arising as we look at the code from a long-term support point of view.

I'll try to use the future-work tag to indicate this.

@bzaar
Copy link
Contributor

bzaar commented Jul 18, 2017

Yes, I've noticed the future-work tag. Thanks.

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

No branches or pull requests

3 participants