The call graph generator will use Roslyn to walk the call graph of a C# solution from a specified entry point and generate a plant uml sequence diagram.
This sequence diagram text file can then be be turned into a diagram through a number of ways:
One suggestion is to generate SVGs if the call graph is large, as the SVGs can be zoomed in and out.
PlantUml Call Grapher
Description:
PlantUml Call Grapher
Usage:
CallGraphGenerator <file> <namespace> <class> <method> [options]
Arguments:
<file> The project or solution file to process.
<namespace> Namespace of entry point
<class> Class of entry point
<method> Method entry point
Options:
-o, --output <output> Optional output file
-l, --leaf <leaf> Classes that should not be parsed further.
-i, --ignore <ignore> Classes that should be completely ignored.
--version Show version information
-?, -h, --help Show help and usage information
The following example will run the call graph generator for the HelloWorld project, located
in the example folder, for the Main() method.
It will save the output in the example.puml file instead of outputing it to the standard output.
$ CallGraphGenerator/bin/Debug/net6.0/CallGraphGenerator \
example/HelloWorld/HelloWorld/HelloWorld.csproj \
HelloWorld Program Main \
-o example.pumlThe output should look like the graph at the top.
The one thing of note is that recursive calls are displayed with an arrow pointing back to the same method, ending with a circle.
Copyright (c) 2023 Barnebys Group AB
