Shotgun surgery is similar to divergent change. If you encounter a change, you must make many small changes in many different classes. The bad thing you face is shotgun surgery ). If you want to modifyCodeIt is difficult for you to find them and easily forget an important modification.
You can use the move method and move field to put all the code to be modified into the same class. If no suitable class exists, create one. Generally, you can use inline class to put a series of related behaviors into the same class. This may cause a small amount of divergent changes, but it is easy to come out.
Divergent change refers to "one class is affected by multiple changes", and shotgun surgery refers to "one change causes multiple class modifications ". In both cases, you may want to organize the code to make the "external changes" and "classes to be modified" one by one.