Imaginary Tool: Disjoint Function Detector

An antipattern one runs into on a pretty regular basis is the overly-extended function:

def doFoo()
     code to do foo>
end

Evolves over time, and becomes

def doFoo(special=false)
    if special
        <do something> 
    end 

    <code to do foo> 
end

But in the worst case, it evolves further and becomes

def doFoo(special=false) 
    if (special)
        <do special>
    else
        <do foo> 
    end
end

At this point, it's pretty obvious that these shouldn't be in the same function. They don't express common functionality anymore really.

I want a tool that will tell me if there's a parameter to a function that creates two disjoint sets of control flow. This would be a good indication that something about the function needs to be refactored!