Sourcetrail, a free, cross-platform code explorer

about Sourcetrail

In the next article we are going to take a look at Sourcetrail. This is a free source code explorer and open for Gnu / Linux, Windows and macOS. With this we will be able to explore any source code easily. It is a browser that works offline, so it is not necessary to connect to the Internet, which will keep our codes safe.

The program provides a full overview, source code details combining an interactive dependency graph and a concise code view. Is currently compatible with C, C ++, Java and Python and we can synchronize it with our favorite code editor like Atom, Eclipse, Emacs, IntelliJ IDEA, QtCreator, Sublime Text, vim, Visual Studio Code through the plugin.

Nowadays if a project reaches a certain size, it is difficult to maintain a consistent mental model of the structure of the source code. The problem here is not the poor abstraction of the language, but the high information density of the code. Every line in the source code has a purpose, and since software developers spend most of their time looking for those little pieces that are relevant, this software comes to give them the possibility to see how the components are connected to each other, without having to constantly look at every detail of the code.

Sourcetrail working example

Software developers spend most of their time deciphering existing source code, and common code-editing tools often offer little help with this task. Sourcetrail provides overview and details by combining an interactive dependency graph, concise code view, and efficient code search. All built into one easy-to-use cross-platform developer tool. Furthermore it also results from user assistance by allowing you to explore legacy code, understand implementation, and refactor software architecture.

Sourcetrail general features

sourcetrail preference

  • We can index our source code. Sourcetrail's in-depth static analysis will find all definitions and references within our source files. To start the static code analyzer, we can import an existing build configuration or choose manual project configuration.
  • The program allows you to find any symbol. We will have the possibility of use Sourcetrail's search field to quickly find any symbol within the entire codebase. Fuzzy code search engine gives us the best matches in just a few clicks.

sourcetrail example 1

  • We will have the possibility of explore dependencies visually. The graph display provides a quick overview of any class, method, field, etc., and all of its relationships. The dependency graph is fully interactive, we can use it to move around the code base.
  • We will have the possibility to explore our source code. The code view contains all the implementation details of the element in focus within a well-organized list of code snippets. We can further inspect the scopes and highlight the local variables, or focus on any other reference or found element.
  • The program will allow us to connect our source editor. We will be able to synchronize Sourcetrail with our favorite source code editor through a plugin. This allows you to easily switch between typing and exploring.

These are just some of the features of the program, you can consult all of them in detail from the project blog.

Install Sourcetrail Source Explorer on Ubuntu

We will find this program available from releases page on GitHub. There we can download the compressed file that can be seen in the following screenshot.

download sourcetrail installer

After downloading, we will open a terminal (Ctrl + Alt + T) and give execution permissions to the install.sh file that we will find inside the folder that will be created after unzipping the file that we download:

sudo chmod +x install.sh

Once we give the execution permission, we can launch this install script running it as follows:

sourcetrail installation

sudo sh ./install.sh

After the installation, we can find the program launcher on our computer.

sourcetrail launcher

Uninstallation

If we want to uninstall the program from our computer, we will only have to go to the / opt / sourcetrail / folder. Once in it, you just have to run the uninstall.sh file To remove the program from the system:

uninstall sourcetrail

sudo ./uninstall.sh

Use as AppImage

custom trail sourcetrail

We can also use Sourcetrail Source Explorer using the AppImage file that we can find in the releases page.

Once the file download is finished, we are going to open a terminal (Ctrl + Alt + T) and we will move to the folder in which we have saved the downloaded file. Then we will execute this other command to make the downloaded file executable:

sudo chmod +x Sourcetrail_2020_1_117_Linux_64bit.AppImage

After the previous command we are going to execute this other one to start Sourcetrail Source Explorer in Ubuntu:

sudo ./Sourcetrail_2020_1_117_Linux_64bit.AppImage

We can get more information about how this program works in the documentation offered on the project website.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.