Continuing on our refactor process, we enter the code consolidation phase. This includes the following processes:
Remove duplicate functions
One of the features of Transformer! is to identify duplicate functions when performing the conversion process but you can always just hunt these down manually, if necessary. There are actually two types of duplicates that you need to identify:
Duplicate Function Names
Are functions that have the same name but have totally different purposes. This usually happens when you have functions that exist in different entities. If you do run into this situation, there are several possible remedies:
1. You can rename the functions to better match their functionality.
2. You can consolidate functions should they be similar, but not exact, in functionality.
These are functions which contain exactly the same functionality, like a FormatPhoneNumber function. We only need one copy of this function so save one and remove the others.
1. Remove duplicate functions, as described above.
3. Move functions into the libraries so that you end up with:
- Entity-specific functions
- General or utility functions
- Ribbon functions