Sourcetrail
Sourcetrail copied to clipboard
Provide graphml export option
In my mind one of the key things (besides visualization) Sourcetrail provides is a useful graph structure for source code that can be used for various types of analysis, without having to go through the pain of writing a clang analyzer yourself. However, since sourcetrail doesn't have plugins (#1076), writing your own analysis tools is a bit of work, and may not let you use other kinds of graph analysis tooling.
I've started on making a graphml exporter at https://gist.github.com/virtuald/95ecfa5047671f008395f5781a359cc7 , but it seems that getGraphForNodeTypes and getGraphForAll don't actually seem to create a full in memory graph.
Updated the gist, using the SqliteIndexStorage directly made this super easy. The graph is usable, but there's more one could do to it.
What a great idea! I really would like to see that included in sourcetrail, as it allows to perform further, graph based architecture analysis. Please include this feature in the next release of sourcetrail!
I could imaging this to be availabe via a command line call. The current API looks like this:
$ Sourcetrail.exe -h
Usage:
Sourcetrail [command] [option...] [positional arguments]
Commands:
config Change preferences relevant to project indexing.*
index Index a certain project.*
* has its own --help
Options:
-h [ --help ] Print this help message
-v [ --version ] Version of Sourcetrail
--project-file arg Open Sourcetrail with this project (.srctrlprj)
Positional Arguments:
1: project-file
For this feature I could imaging an export-graphml command that also requires the --project-file option to know for which project the graphml shall be exported. If anyone wants to implement this, please go ahead!