If it's code you inherited, presumably you have to start reading it and understanding what it does and does not do. I suggest you write unit tests that reflect your growing understanding of the code base. Eventually you will build up a body of knowledge about your legacy application that says 'these functions are the functions that pass those tests' as opposed to 'these functions are the functions that have those implementations'. Then you will have more freedom and confidence to make changes without breaking things.