Git Product home page Git Product logo

spaghetti's Introduction

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

spaghetti's People

Contributors

adonovan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.