jar-graph icon indicating copy to clipboard operation
jar-graph copied to clipboard

Graph analysis of the internal dependencies within a java archive file (JAR).

jar-graph

Build Status

Graph analysis of the internal dependencies within a java archive file (JAR) using the gephi toolkit.

As an example below is a visualization of the Guava internal dependencies. Each node is a class, and edges represent an "imports" dependency. The node size is relative to the in-degree or the number of dependent nodes. guava graph

Installation

Required is Java 8 or later. Download the latest release and extract the archive.

Usage

usage: ./jar-graph.sh -f <jar_file> -p <package> [-t time] [-nhi] [-o out_file] [-w dir] [-r repulsion] [-s font] [-m
min] [-x max]
  -t  time      specify simulation time in seconds
  -n            no graph will be generated
  -h            display help
  -o  outfile   output file outfile
  -w  workdir   working directory
  -r  repulsion node repulsion strength value
  -s  size      font size
  -m  min       minimum node size
  -x  max       maximum node size
  -i            list nodes and their in degree minus out degree

Examples

Guava

./jar-graph.sh -f ../guava-26.0-jre.jar -p com.google -t 60 In this example the script is executed on the Guava 26.0 JAR with a filter of "com.google" which indicates that the analysis will include only classes under the "com.google" package. The simulation is ran for 60 seconds. The resulting PDF can be explored here.

Elasticsearch

./jar-graph.sh -f ../elasticsearch-6.4.1.jar -p org.elasticsearch.common -t 180 This performs analysis of the Elasticsearch 6.4.1 release, limited to package "org.elasticsearch.common". For large projects it is often meaningful to analyze sub-parts separately otherwise resulting graphs may be very "busy". The PDF can be explored here.

License

Copyright © 2018 Kiril Videlov

Distributed under the Eclipse Public License. Thanks to Rich Hickey for creating Clojure.