I wonder what COBOL refactoring tools can do.
https://increment.com/programming-languages/cobol-all-the-way-down/
«COBOL also suffers from the flaws of early computer languages, such as allowing arbitrary jumps via GO TO. While it allowed for procedures, parameters couldn’t be passed, and all variables could be globally modified anywhere in the code. This makes it extremely difficult to predict how any segments of code work in isolation, because you never know whether or not variables that seem to have a local context are being modified elsewhere by intent or error. That in turn makes it almost impossible to have a gestalt view of an entire system. Replacing any piece of code could have completely unpredictable effects on parts not even known to interact with it.»