To refactor or not to refactor? That is (never) the question. Whether you're facing a screenful of spaghetti code, an elusive bug, or a project you inherited from a coworker who programmed in hieroglyphics, this flowchart will tell you if now is the time to refactor.