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

Duplicate function - divide & conquer #23542

Merged
merged 1 commit into from
May 23, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

The formatProfileContact function is a LOT - it is called from the import & causes some notices - however, as a shared function called by lots of legacy code it isn't something we want to mess with.

We have used the divide and conquer function pretty successfully elsewhere - copy the function back to the class & then with it only being called from one place strip it back to the bit that ACTUALLY DOES something

image

Before

Abject fear

After

More duplicate code :-( but a path forwards to add import testing & fix on phone imports

Technical Details

Comments

@civibot
Copy link

civibot bot commented May 22, 2022

(Standard links)

@civibot civibot bot added the master label May 22, 2022
* Legacy format profile contact parameters.
*
* This is a formerly shared function - most of the stuff in it probably does
* nothing but copied here to star unravelling that...
Copy link
Contributor

Choose a reason for hiding this comment

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

star -> start
:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm - I might take that on board for a follow up as I have a few patches locally that build on this

@stesi561
Copy link
Contributor

Have diffed against the original code - this looks fine. There is a change from using self-> to this-> however the calling is now being done not in a static context so this makes sense. Additionally as the original context was static all the changes to calling methods other than this in the original Class are fine.

Haven't had a chance to r-run.

@eileenmcnaughton
Copy link
Contributor Author

thanks @stesi561 - there is good test cover here -

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

Successfully merging this pull request may close these issues.

3 participants