Hello, everyone!
I have a project (related to graph algorithms). It is written by someone else.
The code is horrible:
- public fields, no getters/setters
- huge methods, all public
- some classes have over 20 fields
- some classes have over 5 constructors (which are also huge)
- some of those constructors just leave many fields
null
(so I can't make some fields final, because then every second constructor signals errors) - methods and classes rely on each other in both directions
I have to rewrite this into a clean and understandable API.
Problem is: I myself don't understand anything in this code.
Please give me hints on analyzing and understanding such code.
I was thinking, perhaps, there are tools which perform static code analysis and give me call graphs and things like this.