This anti-pattern applies to methods or classes with a high incoming coupling. Many different modules/components call into one specific module A and are dependent on it. Module A is said to be affected by the Shotgun Surgery anti-pattern.


  • Many design entities (classes, modules) depend on the classes/methods affected by this anti-pattern. If a change occurs in this operation, all dependent classes and operations need to be fixed.
  • Managing all changes becomes a significant task. Maintenance becomes expensive.
  • If an affected method is large and complex (Brain method), refactoring becomes a complex task.
  • Testability is affected. Even a minute change necessitates testing all caller functionality.


  • The affected operation is called by too many other operations. This can be measured by the number of times the operation is called.
  • Incoming calls are from many classes (This can be measured by counting the number of calling classes).


  • Method ‘formatParagraph( )’ of class ‘TextArea’ is accessed by 10 different methods from 6 classes.
  • Any change to this method would affect several dependent methods.


  • Since a lot of functions call into a method affected by Shotgun Surgery, changing this method affects all calling methods. Move functionality (that can logically belong to Shotgun Surgery affected methods) from all client classes into the actual Shotgun Surgery method. This will keep all affected code in one place and also provide better encapsulation. This would also mean changes in the affected method would have minimum impact on callers of this method.
  • If Shotgun Surgery methods are too large and complex, they could most likely be Brain Methods. Try to split such methods into shorter and less complex methods.