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 FXIOS-7301 - Reduce from 390 to 42 lines a property of AddressBarState.swift - help in closure_body_length #22711

Open
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

ionixjunior
Copy link
Contributor

@ionixjunior ionixjunior commented Oct 22, 2024

📜 Tickets

Jira ticket
Github issue

💡 Description

This PR reduces from 390 to 42 lines of the reducer property from the AddressBarState.swift file by extracting the switch case statements to new functions.

The current threshold is 30, and I wasn't able to meet that in this PR. We might need to consider adjusting the threshold or allowing exceptions when we enable this rule. I'm open to any suggestions.

This PR is part of a series of PRs described here #16442 (comment).

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

Copy link
Contributor

mergify bot commented Oct 23, 2024

This pull request has conflicts when rebasing. Could you fix it @ionixjunior? 🙏

@FilippoZazzeroni FilippoZazzeroni requested review from FilippoZazzeroni and removed request for MattLichtenstein October 23, 2024 09:23
Copy link
Collaborator

@FilippoZazzeroni FilippoZazzeroni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 🎉 . Nit things i would change the handle methods name to be (e.g)handleToolbarNumberOfTabsChanged to handleNumberOfTabsChangedAction and also Rebase is needed since i noticed some new actions were added.

@ionixjunior ionixjunior changed the title Refactor FXIOS-7301 - Reduce from 272 to 36 lines a property of AddressBarState.swift - help in closure_body_length Refactor FXIOS-7301 - Reduce from 390 to 42 lines a property of AddressBarState.swift - help in closure_body_length Oct 23, 2024
@ionixjunior
Copy link
Contributor Author

Sure, it makes sense. I'll update this in this another PR #22679. Updated and rebased.

Copy link
Contributor

mergify bot commented Oct 24, 2024

This pull request has conflicts when rebasing. Could you fix it @ionixjunior? 🙏

Copy link
Collaborator

@FilippoZazzeroni FilippoZazzeroni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 super. There is only needed a rebase and we can merge it.

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

Successfully merging this pull request may close these issues.

2 participants