tags:

views:

199

answers:

5

Whether JavaSript, C# or C++ main problem i face while reading the code is which function is called by which function. This problem is big when dealing with BIG code. Is there any static code analysis tool/technique/plugins using which a graphical representation of the code can be generated(something like below) so that reading/analyzing code becomes easy?

....
--outerFuntion()
---innerFunction()
----innerFunction2()
--outerFunction2()
....

Please provide your inputs/opinions on this Thanks all,

+4  A: 

for C++ doxygen is a great open source, free tool that will do such an analysis.
it converts a C++ code to a bowsable crackable colored HTML, you can jump for each function to any of the functions referencing it or functions referenced by it.

there is a graphical representation of functions call graphs and class relationship (it can be configurable to be in UML format)

it will also cross reference variables, classes functions and offer search facilities.

there are a helper tools on the doxygen site to assist in the analysis of other language including C# and JavaScript but I never used any of them

Alon
+1  A: 

For an industrial strength solution, the Understand product provides this sort of static analysis for several different languages. It supports C++ and C# but not Javascript.

Greg Hewgill
+3  A: 

You might want to look at NDepend for .NET

A java and a cpp version are also available.

vaucouleur
A: 

Understand analyst, Doxygen tools are best if you want to reverse engineer your code.

ckv
+1  A: 

CppDepend is very useful for this kind of needs, CppDepend provides a CQL language to query the code base like SQL, for example you can execute requests like:

WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE CyclomaticComplexity > 20 ORDER BY CyclomaticComplexity DESC

Issam