Skip to content

Lapeno01/JarStatsVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JarStatsVisualizer

JarStatsVisualizer is a tool for analyzing Java bytecode using OPAL. It generates metrics, charts, and CSV reports to provide insights into your JAR files.

Jar Stats Visualizer

Key Features

  • Class Analysis: Explore inheritance depth, direct subclasses, and implemented interfaces.
  • Method Analysis: Analyze method invocation counts, identify code smells (e.g., long methods, large classes), and more.
  • Instruction Analysis: Understand the distribution of top instructions.
  • Field Analysis: Evaluate field access modifiers, compare static vs. instance fields, and examine field types.

Table of Contents

  1. Metrics & Reports
  2. Setup & Usage
  3. Customization

Metrics & Reports

  • Class Metrics

    • Class Distribution: Comparison of interfaces, classes, and abstract classes.
    • Inheritance Depth: Measures the depth of class hierarchies.
    • Interface Implementations: Aggregates commonly implemented interfaces by class.
    • Code Smells: Identifies "long classes" for potential refactoring.
  • Method Metrics

    • Code Smells: Detects "long methods" that may require simplification.
    • Method Invocations: Distribution of invocation types across all instruction types.
    • Methods by Access Modifiers: Analyzes different method types using OPAL.
    • Static vs. Instance Methods Distribution: Compares the usage of static and instance methods.
  • Field Analysis

    • Total count of static vs. instance fields.
    • Field access modifiers.
    • Field types, and other attributes.

When the project is executed, Report.scala collects these metrics and generates CSV files and charts.
Examples of the generated files can be found in the output/ folder. The results shown are based on analyzing the WhatsApp.apk, converted to a JAR file.


Setup & Usage

  1. Clone the Repository
    Clone the repository and navigate to the project directory.

  2. Run the Docker Container
    Use run.sh to build and execute the Docker container. Follow these steps:

    • Update the path to the JAR file and the output folder in run.sh.
    • Run the script. It will automatically build the Docker image, execute the container, and save the results to the specified output folder.
    ./run.sh

Customization

  • Metrics Computation

    • Modify or add new logic in the analysis pipeline to customize metrics.
  • Reports & Visualizations

    • Adjust or enhance report generation and visualization styles to fit your needs.

About

Bytecode metrics and visualizations.

Resources

License

Stars

Watchers

Forks

Packages

No packages published