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

Cleanup random findings #519

Merged

Conversation

hiddenalpha
Copy link
Member

  • Add some error handling.
  • Reduce amount of string comparisons where a simple int compare is sufficient.
  • Remove redundant text from some log messages.
  • Don't call toString() twice but re-use value.

- Add error handling.
- Prevent millions of nonsense string comparions where a simple int
  compare is enough.
- Shorten useless complicated messages. Cache result of toString().
- Replace ugly imports.

References (www):
- https://m.youtube.com/watch?v=x2EOOJg8FkA
- https://m.youtube.com/watch?v=EpYr3T5VP6w
- https://medium.com/swlh/yagni-and-dry-the-kiss-of-death-for-your-software-project-cfd44b0654b6#fc82

References (I'm not allowed to make those publicly available):
- https://wikit.post.ch/x/_Bv6Rw
- https://wikit.post.ch/x/iRepPQ
- https://jira.post.ch/browse/SDCISA-10871

(wip @ 284d263)
@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Attention: 27 lines in your changes are missing coverage. Please review.

Comparison is base (16c28a5) 47.41% compared to head (452a8c6) 47.29%.

❗ Current head 452a8c6 differs from pull request most recent head 1572a59. Consider uploading reports for the commit 1572a59 to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #519      +/-   ##
=============================================
- Coverage      47.41%   47.29%   -0.12%     
+ Complexity      1781     1772       -9     
=============================================
  Files            224      224              
  Lines          11672    11684      +12     
  Branches        1225     1227       +2     
=============================================
- Hits            5534     5526       -8     
- Misses          5646     5672      +26     
+ Partials         492      486       -6     
Files Coverage Δ
...isspush/gateleen/core/http/AbstractHttpClient.java 0.00% <0.00%> (ø)
.../java/org/swisspush/gateleen/hook/HookHandler.java 46.81% <47.05%> (-0.86%) ⬇️
...swisspush/gateleen/expansion/ExpansionHandler.java 31.41% <0.00%> (-0.88%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hiddenalpha hiddenalpha added enhancement java Pull requests that update Java code labels Jun 28, 2023
@hiddenalpha hiddenalpha marked this pull request as draft June 29, 2023 16:25
@hiddenalpha hiddenalpha force-pushed the RandomImprovements-20230628 branch 6 times, most recently from bb43b42 to 93e51e0 Compare June 30, 2023 11:13
@hiddenalpha hiddenalpha marked this pull request as ready for review June 30, 2023 14:46
Conflicts:
  gateleen-core/src/main/java/org/swisspush/gateleen/core/http/AbstractHttpClient.java
@hiddenalpha hiddenalpha merged commit 289da09 into swisspost:develop Oct 5, 2023
1 of 3 checks passed
@hiddenalpha hiddenalpha deleted the RandomImprovements-20230628 branch October 5, 2023 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement java Pull requests that update Java code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants