The case of the double-duty function

Split the
Method.

One function has been doing two jobs. Trace its decisions, route each instruction to the right responsibility, and watch the knots come undone.

An illustrated vintage switchboard with a tangled central cable splitting into two tidy circuits
Exhibit A · The branching problem

How to play: Tap A or B beside every line. The same line can look different depending on its job: think about which responsibility it serves, not just the variables it mentions. Then run the tests.

3 CASES · 18 CLUES
CASE FILE 01 / 03

0 / 18
lines correctly routed

The tangled function

READ ONLY · investigate below

Two clean circuits

YOUR REFACTOR

  1. Waiting for a clue…

  1. Waiting for a clue…