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

[Refactor] Improve code quality #379

Closed
2 tasks done
damien-rivet opened this issue Oct 31, 2023 · 9 comments
Closed
2 tasks done

[Refactor] Improve code quality #379

damien-rivet opened this issue Oct 31, 2023 · 9 comments
Assignees
Labels
feature New feature or request help wanted Extra attention is needed refactor Refactor code to improve quality

Comments

@damien-rivet
Copy link
Contributor

Terms

Description

The whole codebase could benefit from a code quality upgrade.

A non-exhaustive list:

  • Remove all instance of force-unwraps
  • Replace usage of if something { let something } checks with guard let and if let whenever possible to allow for early return and nil-unwrapping safety
  • Use isEmpty instead of .count
  • Move hardcoded strings and magic numbers into dedicated constants (sizes, languages, keyboards, keys, icons, etc.)

Contribution

No response

@damien-rivet damien-rivet added the feature New feature or request label Oct 31, 2023
@andrewtavis andrewtavis added help wanted Extra attention is needed refactor Refactor code to improve quality labels Oct 31, 2023
@henrikth93
Copy link
Member

I am interested in this one

@andrewtavis
Copy link
Member

Thanks @henrikth93! Let me know if there's something I can do to support! 😊

@andrewtavis
Copy link
Member

Via a call that @henrikth93 and I are having, we've decided that this can be done on a basis where changes can be sent for individual or smaller groups of files 😊

@LeTarrask
Copy link

@henrikth93, @andrewtavis, can I also have a shot in a few of those issues? maybe just small linting and replacing ifs for guard let, and stuff?

@andrewtavis
Copy link
Member

Sounds good to me, @LeTarrask! Let's wait for @henrikth93 to confirm in case he's been working on them already :) Thanks for your interest in helping out!

@henrikth93
Copy link
Member

@LeTarrask @andrewtavis My focus is on fixing magic numbers at the moments, so feel free Alex!

@andrewtavis
Copy link
Member

Fantastic :) Let us know if you have any questions, @LeTarrask!

@jocoand
Copy link
Contributor

jocoand commented Jan 6, 2024

Hello, I'm interested in working on this

I plan to do some .count replacement stuff, can I work on that?

@andrewtavis
Copy link
Member

andrewtavis commented Apr 1, 2024

da23dd0 sent along tons of changes to address force unwraps, use if let/guard let more and also added in usages of isEmpty where possible (also d0e621e worked on isEmpty). The error handling of if let and guard let can definitely be improved, but I'd say that for this and any other parts that can be improved we can switch to individual issues :) Thanks all so much for the contributions here! Really is such an improvement, and I'm looking forward to where we go from here!

If anyone sees anything in da23dd0 or in the current codebase that should be worked on, please open an individual issue for it and we'll get to it when we can!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request help wanted Extra attention is needed refactor Refactor code to improve quality
Projects
Archived in project
Development

No branches or pull requests

5 participants