Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide graphml export option #1085

Open
virtuald opened this issue Sep 22, 2020 · 3 comments
Open

Provide graphml export option #1085

virtuald opened this issue Sep 22, 2020 · 3 comments

Comments

@virtuald
Copy link

@virtuald virtuald commented Sep 22, 2020

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.

@virtuald
Copy link
Author

@virtuald virtuald commented Sep 22, 2020

Updated the gist, using the SqliteIndexStorage directly made this super easy. The graph is usable, but there's more one could do to it.

@mrkdev
Copy link

@mrkdev mrkdev commented Oct 23, 2020

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!

@mlangkabel
Copy link
Contributor

@mlangkabel mlangkabel commented Nov 18, 2020

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.