Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good code visualization / refactoring tools for C++?

I've found myself coming across a lot of reasonably large, complicated codebases at work recently which I've been asked to either review or refactor or both. This can be extremely time consuming when the code is highly concurrent, makes heavy use of templates (particularly static polymorphism) and has logic that depends on callbacks/signals/condition variables/etc.

Are there any good visualization tools for C++ period, and of those are there any that actually play well with "advanced" C++ features? Anything would probably be better than my approach now, which is basically pen+paper or stepping through the debugger. The debugger method can be good for following a particular code path, but isn't great for seeing the big picture you really need when doing serious refactoring.

EDIT: I should mention that Visual Studio plugins aren't going to be a lot of help to me, since our stuff is mostly Linux-only.

like image 557
Paul D. Avatar asked May 18 '10 18:05

Paul D.


2 Answers

You could use Doxygen to get you started; once the easy part is done (class layout, hierarchies, ...) you need to write about the rest of the software that cannot be easily be process by tools like doxygen.

good luck.

M.

like image 177
Max Avatar answered Sep 26 '22 08:09

Max


Visualising:

I'm not aware of what's going on outside of the UML world, but what is available within it does not reverse engineer modern, template based C++ at all well. At best, you will get simple class diagrams.

Refactoring:

Mozilla created the dehydra / Pork tools to analyse and refactor their C++ source to change their old-style XPCOM and memory management with better idioms. It's not tied to a visualisation tool, instead uses pattern matching and JavaScript. I haven't tried it myself, being fortunate to not having been in a position where it's required.

like image 32
Pete Kirkham Avatar answered Sep 26 '22 08:09

Pete Kirkham