Skip to content

manojkumarredbus/graphify-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphify Java

Graphify is a static analysis tool designed to scan Java projects and generate comprehensive graph-based reports. By leveraging graph theory, Graphify provides insights into the structure, complexity, and modularity of your Java codebase.

Project Overview

Graphify parses Java source code to identify entities (classes, methods, fields) and their inter-relationships (inheritance, calls, usage). It then builds a directed graph where entities are nodes and relationships are edges. On this graph, it performs various analyses, such as:

  • PageRank Analysis: Identifying the most "central" or influential components in the project.
  • Community Detection: Grouping related entities into clusters to reveal the natural boundaries of the system.

The results are exported as a JSON data file for further visualization and a Markdown report for human readability.

Project Structure

The project is organized into several modules, each with a specific responsibility:

  • graphify-core: Contains the core data models (Entity, Relationship, ExtractionResult) used across the entire system.
  • graphify-parser: Uses JavaParser to scan source directories and extract architectural information.
  • graphify-graph: Transforms the raw extracted data into a graph representation using JGraphT.
  • graphify-analysis: Implements analysis algorithms (PageRank, Community Detection) to provide metrics on the code graph.
  • graphify-export: Handles the generation of output files, including JSON graphs and Markdown summary reports.
  • graphify-cli: A command-line interface (powered by picocli) that integrates all modules into a single tool.

Requirements

  • Java 23 or higher.
  • Windows environment (for run-graphify.bat).

How to Build

The project uses Gradle as its build system. You can build all modules and prepare the distribution by running:

./gradlew build

To specifically prepare the CLI distribution:

./gradlew :graphify-cli:installDist

How to Run

A convenient batch script run-graphify.bat is provided to automate the build and execution process.

Basic Usage

run-graphify.bat <path-to-java-project>

Options

  • <path-to-java-project>: (Required) The root directory of the Java project you want to analyze.
  • -o, --output <path>: (Optional) The directory where reports will be saved. Defaults to the current directory.

Example

run-graphify.bat C:\Dev\MyProject -o C:\AnalysisReports

This will:

  1. Verify your Java version.
  2. Build the Graphify project.
  3. Scan C:\Dev\MyProject.
  4. Generate graph_data.json and a Markdown report in C:\AnalysisReports.

About

graphify-java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors