I am creating code detectors for code . Often I see several sets of ABCPQ code found as clones where ABC are conceptually coherent and PQ are conceptually coherent, but ABC and PQ are not related. A clone detector (or an uneducated reader of your code) will see the same sequence as the clones. Yes, you could try to make a bad FOOBAR abstraction from ABCPQ, but from a principled point of view of the reader, you better make only ABC inyo abstraction, and then consider what to do with P Q clones.
I do not know if this is applicable in your situation, since all your calls are sockets (ABC?), And I am not familiar with your interface.
source share