Sourcetrail 2018.2 brings cleaner graph layouts and grouping of graph nodes by defining file or parent namespace/package. Code display times have been improved, especially for code snippets and large files. There have been some usability improvements for fixing errors during project setup, and some overall style improvements.

Sourcetrail's graph interface showing the new grouping by namespace feature.

This images shows the clang::tooling::ToolInvocation class of the LLVM/Clang codebase, which you can download as pre-indexed Sourcetrail sample project from our download page.

New in this Release:

Graph View : cleaner graph layouts; grouping nodes by containing file or parent namespace/package; group nodes in inheritance hierarchy; show include edges for non-indexed files; show symbols defined within a file inside the respective file node;

: cleaner graph layouts; grouping nodes by containing file or parent namespace/package; group nodes in inheritance hierarchy; show include edges for non-indexed files; show symbols defined within a file inside the respective file node; Code View : faster loading of code snippets and large files;

: faster loading of code snippets and large files; UI Updates : allow non-ASCII characters in file paths and search queries; new style for status view; updated to Qt 5.10.1;

: allow non-ASCII characters in file paths and search queries; new style for status view; updated to Qt 5.10.1; Errors : show all errors related to a file; sort errors by column; clear errors in non-indexed files;

: show all errors related to a file; sort errors by column; clear errors in non-indexed files; C/C++: show include information of non-indexed files; updated to LLVM/Clang 6.0

You can download Sourcetrail 2018.2 here. The full changelog is available here. Going more into detail, I will outline the most important features new to this release and show a few examples below.

Graph

There have been major improvements in the graph UI with this new release. Mostly in streamlining the layout and using groupings in appropriate places.

Reduced edge overlapping

Edge overlapping has been reduced by respecting column widths in the layout and additionally leaving a horizontal gap for edges to pass through. Take a look at the before and after comparison to get an idea.

Before and after comparison of graph edge routing.

Grouping nodes by containing namespace or defining file path

A lot of codebases are not written in a purely object oriented manner, where one file equals one class. Some developers/languages prefer functional style coding over object orientation. In other codebases the namespace/package structure is essential to understanding how the different parts of the codebase come together. So far Sourcetrail’s graph visualization was mainly focused on displaying classes and functions, leaving out other contextual information.

To help developers in exploring and understanding codebases that rely on these contextual information, we added optional grouping by either file path or namespace/package to the graph view. The grouping can be enabled via the two group buttons in the top left corner of the graph view. If either is enabled, all nodes belonging to the same parent context will get grouped together.

Grouping by namespace on the left and by file path on the right.

This is a first iteration on this grouping feature. In the future we can extend it to also provide grouping by directory, library, language, etc. Although the usefulness of the feature really depends on the codebase. In some cases it might just add additional clutter and impair graph readability. You really need to decide for yourself if you use it.

Inheritance graph groupings

Inheritance graphs in some code bases tend to become very wide, due to the reason that there is often one common base class for a lot of derived types. In these situations the resulting graph hierarchy in Sourcetrail also became very wide and hard to read.

Before grouping inheritance trees by common base and derived classes.

To fix this we implemented a suggestion of one of our users: he proposed to group nodes that share the same base and derived classes together. That way the resulting graphs become a lot more concise, easier to read and contain less edges. If desired the groups can be split again by clicking within the bordered area. Alternatively we also thought about switching to a horizontal layout instead of a vertical one, where the problem is less apparent, but decided to keep a consistent layout direction throughout all graph visuals.

After grouping inheritance trees by common base and derived classes.

These images show the inheritance diagram of the clang::Decl class of the LLVM/Clang codebase, which you can download as pre-indexed Sourcetrail project from our downloads page.

Show include edges for non-indexed files

Sourcetrail now also stores include edges for non-indexed C/C++ files. This may be incredibly helpful if you have a (fatal) error in a non-indexed file and you want to see the including file hierarchy to figure out which source files may be affected.

Include relations are shown for non-indexed files.

Show symbols defined within file node when activating file

This was also a feature request that has been open for some time. When activating a file node, you will now see all symbols defined within this file, shown as children within the node. The file node can be collapsed to hide this information.

Symbols defined within a file are shown as children in the file node.

Allow non-ASCII characters in file paths, search queries and bookmarks

We started supporting different text encodings for source files in a previous release, but we didn’t properly take care of non-ASCII characters in file paths and user inputs so far. With the new release we fixed problems arising with non-ASCII characters in all file paths entered in project setup as well as text strings entered into search, on-screen search and bookmarks.

New style for status view

The style of the status view has been improved to better exhibit the tab selectors. The view now also features a close button on the right of the tab bar, since closing it has always been cumbersome via the menu.

Before and after comparison of status view.

Show all errors related to a file

Making project setup easier has always been a focus from version to version. One recurring problem users reported was the lack of information of why a certain source file is not completely indexed. To tackle this we added a show errors button to the title bars of incomplete files in the code view. After clicking it, the errors table will only show the errors related to this specific file.

Show errors button in the code view and sortable error table columns.

Additionally we also made the columns in the error table sortable. That way it’s easier to see errors with the same message, or errors located in the same file.

Thanks for reading, we hope that you like our progress! Don’t forget to download the new release build.

Follow us: mail - Twitter - Facebook - Google+