Spaghetti: a dependency analysis tool for Go packages

Spaghetti: a dependency analysis tool for Go packages

Spaghetti is an interactive web-based tool to help you understand the dependencies of a Go program, and to explore and evaluate various possible efforts to eliminate dependencies.

It displays the complete dependencies of the initial packages, organized into a tree based on the directory structure of the package/module namespace.

Clicking on a package node displays information about it, including an arbitrary path to it from one of the initial packages. Each edge in the path may be "broken", causing it to be removed from the graph and the view recomputed. The broken edges are tabulated, and each can be restored if you change your mind or try another approach. In this manner, you can explore how your overall dependencies would change as you work to remove specific imports. Once you are happy with the overall dependencies, the set of broken edges becomes your task list for a clean-up project.

Run it like so:

$ go install github.com/adonovan/spaghetti@latest   # install in $HOME/go/bin
$ ~/go/bin/spaghetti [package] &                    # run the server
$ open http://localhost:8080                        # open in chrome, firefox, etc

where package is or more Go packages, or a pattern understood by go list. Then point your browser at the insecure single-user web server at localhost:18080.

This tool is a rewrite from scratch of a tool I wrote while at Google for exploring the dependency graphs used by the Blaze build system. The basic design could be easily be generalized to support any kind of dependency graph, independent of language or domain, or turned into a secure multi-user web service that operates on graph data uploaded from the client program that generates it.

You can probably tell that web UIs are not my expertise. PRs that provide cosmetic improvements are most welcome!

Screenshot

Owner
Alan Donovan
Software engineer at GitHub; ex-Googler; co-author of https://gopl.io.
Alan Donovan
Similar Resources

Go Dependency Analysis toolkit

Goda is a Go dependency analysis toolkit. It contains tools to figure out what your program is using.

Jan 2, 2023

Nut is a tool to manage versioned Go source code packages, called "nuts".

nut Nut is a tool to manage versioned Go source code packages, called "nuts". gonuts.io – central repository (source code) Documents Stable API Mailin

Jul 15, 2021

It is an easy and fast tool to install your packages with just one command.

Trouxa It is an easy and fast tool to install your packages with just one command. What means "Trouxa"? In portuguese, Trouxa means something like a "

Sep 29, 2022

Vilicus is an open source tool that orchestrates security scans of container images(docker/oci) and centralizes all results into a database for further analysis and metrics.

Vilicus is an open source tool that orchestrates security scans of container images(docker/oci) and centralizes all results into a database for further analysis and metrics.

Vilicus Table of Contents Overview How does it work? Architecture Development Run deployment manually Usage Example of analysis Overview Vilicus is an

Dec 6, 2022

Standardized Malware Analysis Tool

S.M.A.T Standardized Malware Analysis Toolkit Capabilities Unpac.me sample submission download results check if already submitted MWDB query for confi

Oct 25, 2022

bodyclose is a static analysis tool which checks whether res.Body is correctly closed.

bodyclose is a static analysis tool which checks whether res.Body is correctly closed. Install You can get bodyclose by go get command. $ go

Jan 6, 2023

This static analysis tool works to ensure your program's data flow does not spill beyond its banks.

Go Flow Levee This static analysis tool works to ensure your program's data flow does not spill beyond its banks. An input program's data flow is expl

Dec 1, 2022

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

reviewdog - A code review dog who keeps your codebase healthy. reviewdog provides a way to post review comments to code hosting service, such as GitHu

Jan 2, 2023

A Golang tool that does static analysis, unit testing, code review and generate code quality report.

A Golang tool that does static analysis, unit testing, code review and generate code quality report.

goreporter A Golang tool that does static analysis, unit testing, code review and generate code quality report. This is a tool that concurrently runs

Jan 8, 2023

pprof is a tool for visualization and analysis of profiling data

Introduction pprof is a tool for visualization and analysis of profiling data. pprof reads a collection of profiling samples in profile.proto format a

Jan 8, 2023

🌘🦊 DalFox(Finder Of XSS) / Parameter Analysis and XSS Scanning tool based on golang

🌘🦊 DalFox(Finder Of XSS) / Parameter Analysis and XSS Scanning tool based on golang

Finder Of XSS, and Dal(달) is the Korean pronunciation of moon. What is DalFox 🌘 🦊 DalFox is a fast, powerful parameter analysis and XSS scanner, bas

Jan 5, 2023

Analyzer: zapvet is static analysis tool for zap

zapvet zapvet is static analysis tool for zap. fieldtype: fieldtype finds confliction type of field Install You can get zapvet by go install command (

Sep 18, 2022

a simple golang SSA viewer tool use for code analysis or make a linter

a simple golang SSA viewer tool use for code analysis or make a linter

ssaviewer A simple golang SSA viewer tool use for code analysis or make a linter ssa.html generate code modify from src/cmd/compile/internal/ssa/html.

May 17, 2022

Retnilnil is a static analysis tool to detect `return nil, nil`

retnilnil retnilnil is a static analysis tool for Golang that detects return nil, nil in functions with (*T, error) as the return type. func f() (*T,

Jun 9, 2022

tfacon is a CLI tool for connecting Test Management Platforms and Test Failure Analysis Classifier.

Test Failure Classifier Connector Description tfacon is a CLI tool for connecting Test Management Platforms and Test Failure Analysis Classifier. Test

Jun 23, 2022

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

reviewdog - A code review dog who keeps your codebase healthy. reviewdog provides a way to post review comments to code hosting service, such as GitHu

Jan 7, 2023

Bodyclose: a static analysis tool which checks whether res.Body is correctly closed

bodyclose bodyclose is a static analysis tool which checks whether res.Body is correctly closed. Install You can get bodyclose by go get command. $ go

Dec 9, 2021

Metrics go: CudgX indicator management tool, which integrates monitoring and data analysis indicator capabilities

Metrics-Go metrics-go 是cudgx指标打点工具,它集成了监控和数据分析指标能力。 数据流程 指标数据流程为: 用户代码调用打点 SDK指标

Oct 13, 2022
Comments
  • GitHub actions ci and refactor

    GitHub actions ci and refactor

    With this PR I add the following enhancements:

    • Follow Go community suggested project layout: https://github.com/golang-standards/project-layout
    • CI/CD support for automation code checks and delivery release artifacts (executables for all platforms that could be downloaded from the repository releases page). Release initiated by adding semver tag https://semver.org/
    • Add makefile automation
    • Helper scripts for compiling, linting, and releasing the application
  • add cosmetic improvements

    add cosmetic improvements

    Let me know if I broke something unexpectedly 🙇🏼 This is how it looks now. I ended up using Bulma because it was a bit easier to integrate as compared to Bootstrap. Resolves #2

    Screenshot from 2021-05-06 16-22-13

  • Improve cosmetic appearance of HTML

    Improve cosmetic appearance of HTML

    Would improving the cosmetic appearance of HTML be just adding CSS to the existing HTML file? If my understanding is correct, introducing a complicated build process for generating static assets is not required right? I was considering perhaps making a PR where I just link an external minified CSS of a CSS framework/library (perhaps from a CDN) and using classes present with the CSS framework/library to improve the cosmetic appearance of the HTML.

Go dependency management tool experiment (deprecated)
Go dependency management tool experiment (deprecated)

Dep dep is a dependency management tool for Go. It requires Go 1.9 or newer to compile. NOTE: Dep was an official experiment to implement a package ma

Dec 23, 2022
dependency tool for go

Godep - Archived Please use dep or another tool instead. The rest of this readme is preserved for those that may still need its contents. godep helps

Dec 14, 2022
A simple dependency manager for Go (golang), inspired by Bundler.
A simple dependency manager for Go (golang), inspired by Bundler.

Goop A dependency manager for Go (golang), inspired by Bundler. It is different from other dependency managers in that it does not force you to mess w

Sep 27, 2022
Barebones dependency manager for Go.
Barebones dependency manager for Go.

Go Package Manager Go Package Manager (or gpm, for short) is a tool that helps achieve reproducible builds for Go applications by specifying the revis

Dec 14, 2022
Barebones dependency manager for Go.
Barebones dependency manager for Go.

Johnny Deps Johnny Deps is a small tool from VividCortex that provides minimalistic dependency versioning for Go repositories using Git. Its primary p

Sep 27, 2022
Go Package Manager (gopm) is a package manager and build tool for Go.

?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? In favor of Go Modules Proxy since Go 1.11, this pr

Dec 14, 2022
Go tool for major version upgrades

GOMAJOR $ gomajor help GoMajor is a tool for major version upgrades Usage: gomajor <command> [arguments] The commands are: get upgrad

Dec 29, 2022
Documentation side of the spaghetti cutter.
Documentation side of the spaghetti cutter.

spaghetti-analyzer - Win The Fight Against Spaghetti Code Overview spaghetti-analyzer is a command line tool for CI/CD pipelines (and dev machines) th

Dec 7, 2022
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.

Clean Architecture checker for Golang go-cleanarch was created to keep Clean Architecture rules, like a The Dependency Rule and interaction between mo

Dec 31, 2022