Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen to document all functions in a class with call graph?

What would be the best way to figure out all the calls made in a C++ class? I would like to not only find all the calls, I want to find out functions that aren't being called at all so I could clean up my code. I have heard that doxygen can work miracles when it generates the call graphs but it seems it is only generating call graphs for my constructor and like one other function when I have a bunch more I need.

All my class functions have been documented.

like image 424
user1496542 Avatar asked Aug 23 '12 12:08

user1496542


People also ask

How do you create a call graph in Doxygen?

You have to set HAVE_DOT , CALL_GRAPH and CALLER_GRAPH to YES . Also make sure the path to dot is in your PATH variable. If that still doesn't work, you might have to set EXTRACT_ALL and/or EXTRACT_STATIC , depending on your functions. Apologies, I do have HAVE_DOT, CALL_GRAPH, and CALLER_GRAPH set to YES.

Can Doxygen generate class diagram?

Doxygen Manual: Graphs and diagrams. Doxygen has built-in support to generate inheritance diagrams for C++ classes.

How do you create a dependency graph in Doxygen?

Make sure the following options are set in the Doxywizard dialog: In Wizard tab, under Output, select HTML output. In Wizard tab, under Diagrams, choose the option Use dot tool from the GraphViz package. Select the following two options below it: Include dependency graphs and Included by dependency graphs.


1 Answers

We really need more information here, for example, have you documented all your class methods? Have you made any changes to the default doxygen configuration file? As a first step try setting

CALL_GRAPH = YES
EXTRACT_ALL = YES 
EXTRACT_LOCAL_CLASSES = YES

in the doxygen configuration file.

like image 114
Chris Avatar answered Oct 09 '22 01:10

Chris