Giter Site home page Giter Site logo

rodrigo-brito / gocity Goto Github PK

View Code? Open in Web Editor NEW
1.8K 29.0 139.0 10.52 MB

:bar_chart: Code City metaphor for visualizing Go source code in 3D

Home Page: https://go-city.github.io

License: MIT License

Go 97.32% Makefile 0.64% Dockerfile 0.39% HTML 1.64%
golang go react visualization hacktoberfest

gocity's Introduction

GoCity

Actions Status codecov Go Report Card GoDoc License MIT


Available here: https://go-city.github.io

Research Paper: 26th International Conference on Software Analysis, Evolution and Reengineering (SANER)
PDF Version: ASERG Page

GoCity is an implementation of the Code City metaphor for visualizing source code. GoCity represents a Go program as a city, as follows:

  • Folders are districts
  • Files are buildings
  • Structs are represented as buildings on the top of their files.

Structures Characteristics

  • The Number of Lines of Source Code (LOC) represents the build color (high values makes the building dark)
  • The Number of Variables (NOV) correlates to the building's base size.
  • The Number of methods (NOM) correlates to the building height.

Installation

  • go install github.com/rodrigo-brito/gocity@latest
  • Or just head to the releases page and download the latest version for you platform.

Usage:

  • Online: https://go-city.github.io
  • Commands
    • gocity server - Start server
    • gocity open <GITHUB_IMPORT> - Open a specific Github project from github
    • gocity open ./my-project - Open a local directory

UI / Front-end

The UI is built with React and uses babylon.js to plot 3D structures. The front-end source code is available in the front-end branch.

Related Works

This tool makes part of a scientific research developed at Federal University of Minas Gerais (UFMG)
Student: Rodrigo Brito
Advisor: Marco Tulio Valente

gocity's People

Contributors

alebcay avatar alinebrito avatar ashwithabg avatar billcobbler avatar bombsimon avatar chai2010 avatar dependabot[bot] avatar faabiosr avatar flrnd avatar hemantjoshi11 avatar howieyuen avatar juliovcruz avatar marco-silveira avatar pavan-kalyan avatar rafaelrubbioli avatar rafaelsq avatar rodrigo-brito avatar tullur avatar vidu171 avatar wicked7000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gocity's Issues

Remove Travis badge

Travis is not used in this repository.
The issue consists in remove this badge in the readme.

image

Eliminate utils package

This issue consists in move all methods from the utils package to another package.
Suggestion utils -> lib/file.

How to stop rotation

Does anyone know how to stop the scene rotation? Right now it stops for about 2 seconds on mouse click, and then restarts automatically. Gives me a headache when I'm trying to analyze a large codebase, makes it too easy to get lost in the streets. ;-) It would be great if it could be made to stop completely, and then restart on next click. I've been looking through the javascript, and I can't even find the handler that's stopping it for those two seconds or so.

Related -- I also can't find the handlers for drag, rotate, zoom. I'm thinking to add more functionality, like pan.

cleanup and refactor

While working on #66 and #76 I'm finding that working on this project is pretty unwieldy due to half of the code being in a different branch -- it really needs to be refactored into one branch. As things stand right now, it's certainly chasing off contributors -- taking a look at the forks makes me think there are a bunch of folks who have done a lot of work but who haven't been able to merge what they've done back into the master repo -- there are some duplicate efforts going on out there as well. I'm finding that the split-branch situation turns what should be a fun set of enhancements into a real chore.

I'm adding a stanza to the Makefile in my own fork to manage the two branches, copying assets over as mentioned in the comments in #66, but it's a horrible kludge.

@rodrigo-brito, you mention in #66 that the split branches was due to getting github to recognize the project as Go rather than javascript, but I'm not following that reasoning -- why do we care what language github shows for the project? Mixed-language projects are common -- any large project is going to be mixed-language. There must be something I'm missing.

Other refactoring that would help:

  • better version control of node modules including yarn, e.g. committing package.lock, would help -- I had to do some hunting around to figure out a working combination.
  • build instructions -- figuring those out took some time

I'd be happy to submit PRs to clean up any of this, but the split-branch situation makes that extra hard and is likely a prereq.

Improve Coverage

This issue is valid until we reach 100% of coverage ๐Ÿ˜„. The current coverage is codecov.
You can help with a simple test case. ๐Ÿ‘

Ability to exclude files

Repositories like kubernetes have very large generated files that make visualization of other components harder.

The ability to exclude files/directories would be a nice enhancement.

Add badge generator

Hi!
It would be sweet to have beside the star and fork button at the top right corner, a badge generator, that simply link to the repo, like any other badge system it would simple generate a little markdown snippet for those who want to include a link to their code through gocity it in their README.

I think it's a fun idea, I'd like to do the PR myself but I'm really bad at designing anything graphical, so if someone is up for designing a little badge for gocity?

Have a nice day!

Frontend include firebase API key

These probably shouldn't be committed on the public repo:

       var config = {
          apiKey: "AIzaSyBe0Zg96mH5EXPm34yRUTrt9F1ZpJqPyPM",
           authDomain: "gocity-6bbdf.firebaseapp.com",
           databaseURL: "https://gocity-6bbdf.firebaseio.com",
           projectId: "gocity-6bbdf",
           storageBucket: "gocity-6bbdf.appspot.com",
           messagingSenderId: "601884113852"
       };```

Fix codecov badge

The codecov badge is not working, maybe the API changed and it stop to work.

image

Installation fails

I run go get -v -u github.com/rodrigo-brito/gocity and get this:

github.com/rodrigo-brito/gocity
../../../go/src/github.com/rodrigo-brito/gocity/main.go:29:5: app.Author undefined (type *cli.App has no field or method Author)
../../../go/src/github.com/rodrigo-brito/gocity/main.go:31:15: cannot use []cli.Command literal (type []cli.Command) as type []*cli.Command in assignment
../../../go/src/github.com/rodrigo-brito/gocity/main.go:36:16: cannot use cli.IntFlag literal (type cli.IntFlag) as type cli.Flag in slice literal:
	cli.IntFlag does not implement cli.Flag (Apply method has pointer receiver)
../../../go/src/github.com/rodrigo-brito/gocity/main.go:40:6: unknown field 'EnvVar' in struct literal of type cli.IntFlag

Localhost Redirect

Description

When I start the server using: go run main.go server. The system starts normally and displays the URL: http://localhost:4000. The problem is that when accessing the URL the server loops trying to redirect the client to http://localhost:4000//. This even prevents the use of the open command, which when entering the display URL presents the same problem.

Steps to Problem

  1. Clone Repo;
  2. Use make to install dep;
  3. Run using go run main.go server;
  4. Use the URL provided;
  5. See server logs in terminal;

asciicast

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.