All Projects → ofabry → Go Callvis

ofabry / Go Callvis

Licence: mit
Visualize call graph of a Go program using Graphviz

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Go Callvis

goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report.
Stars: ✭ 3,019 (-18.23%)
Mutual labels:  static-analysis, golang-tools
rtl2dot
C call graph generator
Stars: ✭ 48 (-98.7%)
Mutual labels:  graphviz, callgraph
golintui
A simple terminal UI for Go linters
Stars: ✭ 73 (-98.02%)
Mutual labels:  static-analysis, golang-tools
nestif
Detect deeply nested if statements in Go source code
Stars: ✭ 30 (-99.19%)
Mutual labels:  static-analysis, golang-tools
callGraph
A multi-language tool which parses source code for function definitions and calls
Stars: ✭ 50 (-98.65%)
Mutual labels:  graphviz, callgraph
custom-bytecode-analyzer
Java bytecode analyzer customizable via JSON rules
Stars: ✭ 66 (-98.21%)
Mutual labels:  static-analysis, callgraph
Goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report.
Stars: ✭ 2,943 (-20.29%)
Mutual labels:  golang-tools, static-analysis
Chronos
Chronos - A static race detector for the go language
Stars: ✭ 272 (-92.63%)
Mutual labels:  static-analysis
Rascal
The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
Stars: ✭ 284 (-92.31%)
Mutual labels:  static-analysis
Wotan
Pluggable TypeScript and JavaScript linter
Stars: ✭ 271 (-92.66%)
Mutual labels:  static-analysis
Seahorn
SeaHorn Verification Framework
Stars: ✭ 270 (-92.69%)
Mutual labels:  static-analysis
Dingo Hunter
Static analyser for finding Deadlocks in Go
Stars: ✭ 272 (-92.63%)
Mutual labels:  static-analysis
Freki
🐺 Malware analysis platform
Stars: ✭ 285 (-92.28%)
Mutual labels:  static-analysis
Go Erd
Go-ERD (Entity Relationship Diagrams) for Golang with Graphviz [WIP]
Stars: ✭ 271 (-92.66%)
Mutual labels:  graphviz
Sonar Php
🐘 SonarPHP: PHP static analyzer for SonarQube & SonarLint
Stars: ✭ 288 (-92.2%)
Mutual labels:  static-analysis
Tool lists
Links to tools by subject
Stars: ✭ 270 (-92.69%)
Mutual labels:  static-analysis
Phpstan Strict Rules
Extra strict and opinionated rules for PHPStan
Stars: ✭ 295 (-92.01%)
Mutual labels:  static-analysis
Clang Power Tools
Bringing clang-tidy magic to Visual Studio C++ developers.
Stars: ✭ 285 (-92.28%)
Mutual labels:  static-analysis
Nullaway
A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead
Stars: ✭ 3,035 (-17.8%)
Mutual labels:  static-analysis
Cleancppproject
Clean C++ project for you to use. Features: Modern CMake, CPack, Doxygen, PlantUML, Catch Unit testing, static analysis
Stars: ✭ 276 (-92.52%)
Mutual labels:  static-analysis

gopher

go-callvis

Github release Build status Slack channel

go-callvis is a development tool to help visualize call graph of a Go program using interactive view.


Introduction

The purpose of this tool is to provide developers with a visual overview of a Go program using data from call graph and its relations with packages and types. This is especially useful in larger projects where the complexity of the code much higher or when you are just simply trying to understand code of somebody else.

Features

  • 🆕 support for Go modules! 💥
  • focus specific package in the program
  • click on package to quickly switch the focus using interactive viewer
  • group functions by package and/or methods by type
  • filter packages to specific import path prefixes
  • ignore funcs from standard library
  • omit various types of function calls

Output preview

main

Check out the source code for the above image.

How it works

It runs pointer analysis to construct the call graph of the program and uses the data to generate output in dot format, which can be rendered with Graphviz tools.

Reference guide

Here you can find descriptions for various types of output.

Packages / Types

Represents Style
focused blue color
stdlib green color
other yellow color

Functions / Methods

Represents Style
exported bold border
unexported normal border
anonymous dotted border

Calls

Represents Style
internal black color
external brown color
static solid line
dynamic dashed line
regular simple arrow
concurrent arrow with circle
deferred arrow with diamond

Quick start

Requirements

  • Go 1.13+
  • Graphviz (optional, required only with -graphviz flag)

Installation

go get -u github.com/ofabry/go-callvis
# or
git clone https://github.com/ofabry/go-callvis.git
cd go-callvis && make install

Usage

Interactive viewer

To use the interactive view provided by a web server that serves SVG images of focused packages, you can simply run:

go-callvis <target package>

HTTP server is listening on http://localhost:7878/ by default, use option -http="ADDR:PORT" to change HTTP server address.

Render static output

To generate a single output file use option -file=<file path> to choose output file destination.

The output format defaults to svg, use option -format=<svg|png|jpg|...> to pick a different output format.

Options

Usage of go-callvis:
  -debug
    	Enable verbose log.
  -file string
    	output filename - omit to use server mode
  -cacheDir string
    	Enable caching to avoid unnecessary re-rendering.
  -focus string
    	Focus specific package using name or import path. (default "main")
  -format string
    	output file format [svg | png | jpg | ...] (default "svg")
  -graphviz
    	Use Graphviz's dot program to render images.
  -group string
    	Grouping functions by packages and/or types [pkg, type] (separated by comma) (default "pkg")
  -http string
    	HTTP service address. (default ":7878")
  -ignore string
    	Ignore package paths containing given prefixes (separated by comma)
  -include string
    	Include package paths with given prefixes (separated by comma)
  -limit string
    	Limit package paths to given prefixes (separated by comma)
  -minlen uint
    	Minimum edge length (for wider output). (default 2)
  -nodesep float
    	Minimum space between two adjacent nodes in the same rank (for taller output). (default 0.35)
  -nointer
    	Omit calls to unexported functions.
  -nostd
    	Omit calls to/from packages in standard library.
  -rankdir
        Direction of graph layout [LR | RL | TB | BT] (default "LR")
  -skipbrowser
    	Skip opening browser.
  -tags build tags
    	a list of build tags to consider satisfied during the build. For more information about build tags, see the description of build constraints in the documentation for the go/build package
  -tests
    	Include test code.
  -version
    	Show version and exit.

Run go-callvis -h to list all supported options.

Examples

Here is an example for the project syncthing.

syncthing example

Check out more examples and used command options.

Community

Join #go-callvis channel at gophers.slack.com. (not a member yet? get invitation)

How to help

Did you find any bugs or have some suggestions?

  • Feel free to open new issue or start discussion in the slack channel.

Do you want to contribute to the project?

  • Fork the repository and open a pull request. Here you can find TODO features.

Roadmap

The interactive tool described below has been published as a separate project called goexplorer!

Ideal goal of this project is to make web app that would locally store the call graph data and then provide quick access of the call graphs for any package of your dependency tree. At first it would show an interactive map of overall dependencies between packages and then by selecting particular package it would show the call graph and provide various options to alter the output dynamically.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].