CodeAnalysis

Is there a proper way of analyzing code?:no:

I find it harder to read than it is to write.

Can you be more specific? - what area is hard, what are you trying to do?

I’m not sure if this is what you want, but if you want to perform static code analysis you can also use Understand for C/C++.

Never used Understand, while it probably does its job very well, its a bit expensive ($1000 - 2000), and Im not a big fan of having to buy into it as your IDE (powerful editing tools suggests its an IDE too?).

Though callgraph’s can be useful, Netbeans has a really nice callgraph feature - image below.

For more on setting up netbeans see:
http://wiki.blender.org/index.php/User:Ideasman42/CMakeNetbeansLinux

http://www.graphicall.org/ftp/ideasman42/netbeans_callgraph.png
^^^ right click and view image on its own to see large version.

Neat. I’ve used Netbeans before, but I didn’t know it had that functionality.

Also, there is a free version of Understand. (However, I believe the time expires after 3-4 months with the free version, but this can be easily reset by using Sandboxie cough).

@C-106 Delta, interested to know what tools you find especially useful about Understand, even though I have access to view callgraphs (doxygen, netbeans), I find a simple “Find Usages” which lists users of a function to be just as useful and infact don’t miss this feature from netbeans (I used to use as my main IDE).

This is odd since Id expect it to be useful (logically) - Think the reason I dont miss it is that a graph really only works well for 5-20 items or so, for 200+ it just becomes a mess and there are enough functions that are used 100s of times in our code, at least more times then fit nicely in a graph.

So basically, I found graphs look nice in demo’s but dont scale that well to large callgraphs.

Well all this content has been valuable in clearing up some confusion.
Is there a thread detailing the stepByStep process it takes to get set up.

By set up I’m referring to simply having all the basic equipment to begin manipulating source.

I’ve tried setting up Cmake and was swiftly shut down.
So if there is any further studying that any friendly chap count point me to I’d be much obliged.

tanks.

For Linux Devs Suggest:

http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Linux/Ubuntu/CMake
http://wiki.blender.org/index.php/User:Ideasman42/CMakeQTCreatorLinux

Note that cmake/qtcreator/gcc works on OSX, Windows too - just the instructions cant be followed exactly in those cases.

I’ve tried setting up Cmake and was swiftly shut down.

Comments like this don’t really help solving problems, I try to maintain the CMake building wiki and note any issues in the Trouble shooting section. If it fails - why, what error etc.

It helps to comment the code and/or rename variables to be sure that you understand what is happening and why.

Hey ideasman42.

Man you weren’t kidding; I just checked out Netbeans callgraph feature, and it is sweet. Thanks bud!

I am a novice C++ programmer, and I’m trying to continue teaching myself programming… I’ve started and stopped a number of times in the past. Right now I’m trying to teach myself through Blender’s codebase.


In order to process “dot” call/caller graphs through Doxygen in a reasonable amount of time (by reasonable I mean 1 hour or less) I had to go through and manually delete any files that were not immediately relevant to me.Whereas, Netbean’s call/caller graphs were dynamic and immediate.