Code Monkey home page Code Monkey logo

orgdependencygraph's Introduction

Organization Dependency Graph

This little utility queries your file system and finds out all the NuGet dependencies you have. This works based on the idea that you would clone all the repositories from your organization and dump them into one folder. Then, you would use that folder path and pass this onto this command-line utility.

The output of this will be dumped into Neo4j so that you can query this as you wish.

Preparation

Clone all the repos under a folder. Do this by running the following bash script:

curl "https://api.github.com/orgs/{ORG-NAME}/repos?page=1&per_page=100&type=private&access_token={ACCESS-TOKEN-HERE}" | 
    grep -e 'ssh_url*' | 
    cut -d \" -f 4 | 
    xargs -L1 git clone $1 --depth 1

Increment the page count for enough times to consume all the repos.

Usage

Run the below comment by supplying the correct arguments:

dotnet run "/Users/tugberk/apps/my-org" "http://localhost:7474/db/data" "neo4j" "neo4j"

You can start an instance of a Neo4j database through Docker by running the following command:

docker run \
   --publish=7474:7474 --publish=7687:7687 \
   --volume=$HOME/neo4j/data:/data \
   --volume=$HOME/neo4j/logs:/logs \
   neo4j:3.0

Querying the Data

The data should now be queryable through Cypher Query Language. Here are a few example of the things that you can find out:

Count of Package Dependencies

MATCH (pack:Package)<-[:DEPENDS_ON]-(proj:Project)
RETURN pack.id, count(proj)
ORDER BY count(proj) DESC

A Particular Dependency and Its Projects

MATCH (p:Project)-[:DEPENDS_ON]->(pack:Package)
WHERE pack.id = "Newtonsoft.Json"
RETURN p, pack

Limitations

  • You cannot currently walk the dependency hierarchy with this since it only records the top level dependencies.
  • .NET Core SDK project system is not supported. This omly works for packages.config files.

orgdependencygraph's People

Contributors

tugberkugurlu avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

mallickhruday

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.