Complex sentence: Sherlock tells Anderson that he and Mycroft had anticipated thirteen possible scenarios that could happen on the roof, each of which had a code name and a plan of action attached to it.
Split into simpler sentences: Sherlock tells Anderson that he and Mycroft had anticipated thirteen possible scenarios that could happen on the roof. Each possibility had a code name and a plan of action attached to it.