Minimum cut code relocation?

Hey random thought…
I have noticed in our code its easy for code to be written numerous times in different locations when a developer doesnt know/think to look for other implementations and rewrites in situ. The result is often a function where the input or output types strongly reference another module. Type inference often hides this. I wonder then, would it be possible to do an easing pass on code that would move/suggest to move code to a module where it had the least numer of module references in its type signature?