-
Notifications
You must be signed in to change notification settings - Fork 8
Maintainability #58
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
Maintainability #58
Conversation
costowell
left a comment
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.
Overall looks good. Still not totally sold on the MATCH thing, but totally open to feedback.
database/poll.go
Outdated
|
|
||
| const POLL_TYPE_SIMPLE = "simple" | ||
| const POLL_TYPE_RANKED = "ranked" | ||
| const MATCH = "$match" |
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.
I can see where you're (SonarQube is?) going with this, but I'm not so sure this improves maintainability. I think it'd be better to keep this in the query because that's how mongo queries look like i.e.
{ $match: { salary: 9000 } }
I would like more input though, I could be totally crazy.
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.
I can mark it in SonarQube as a false positive because of the query reasoning
BigSpaceships
left a comment
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!
costowell
left a comment
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
* fixed bug where it would crash if you filled in all canidates + write in (#46) * Check that candidates are not ranked identically (#47) * Check that candidates are not ranked identically * fix bug where write in candidates weren't checked for duplicate rankings * simplified range cause yeah * i think i actually fixed it this time * http response for consistency * removed extra period --------- Co-authored-by: Noah <[email protected]> * Always stop once the majority is hit (#50) @tallen42 * Always stop at majority * End is always true if finalResult is calculated * If hidden, say results soon, otherwise URL (#51) @tallen42 * yippee sonarqube support (#54) @Will-Hellinger * Set up golang CI * go mod tidy * gofmt * Allow hiding results while poll is open this replaces the current hide functionality * Clarify dev setup for compose * go mod download as a separate layer for caching * Allow alumni to dev * Make polls modifiable by removing Reveal Polls that are hidden really shouldn't be revealed * Create dev mode evals override * Clarify gatekeep autoclose for evals * Initial setup for golang tests * Rewrite orderOptions to avoid hanging Also write tests * Run go vet * Maintainability (#58) * min number and cognitive complexity * variable name * revert match constant and import math * Logging dependabot readme pr template (#59) * remove debug log call and added dev flags log messages * update readme with some todos * Create pull request template * Add Dependabot configuration for Go modules * oops forgot target-branch --------- Co-authored-by: Noah Hanford <[email protected]> Co-authored-by: Tyler Allen <[email protected]> Co-authored-by: William Hellinger <[email protected]> Co-authored-by: Max Meinhold <[email protected]>
Fixes 3/5 maintainability issues outlined in dev's PR to main #56
Notes
Doesn't touch the TODO comments (the other 2 SonarQube issues).
Labeled $match issue (sonarqube wanted this to be a constant) as a false positive