Unilyze 0.1.6

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Unilyze --version 0.1.6
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Unilyze --version 0.1.6
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Unilyze&version=0.1.6
                    
nuke :add-package Unilyze --version 0.1.6
                    

unilyze

NuGet

A CLI tool for static analysis and visualization of type dependencies and code quality in Unity projects.

日本語版 / Japanese

For build, test, and release information, see README.dev.md.

Demo

<div><video controls src="https://github.com/user-attachments/assets/60ae2566-f961-4324-a16d-8f384b7d03fd" muted="false"></video></div>

Requirements

  • .NET 8.0 or later

Quick Start

dotnet tool install --global Unilyze

Run in a Unity project directory to open the analysis results in your browser:

cd ~/MyUnityProject
unilyze

Usage

# Analyze current directory and open in browser
unilyze

# Specify project path
unilyze -p ~/MyUnityProject

# Save HTML + JSON to file
unilyze -p ~/MyUnityProject -o graph.html

# Generate HTML/JSON without opening browser
unilyze -p ~/MyUnityProject --no-open

# JSON output only
unilyze -p ~/MyUnityProject -f json -o result.json

# SARIF output (GitHub Code Scanning integration)
unilyze -p ~/MyUnityProject -f sarif -o report.sarif

# Regenerate HTML from existing JSON
unilyze -i result.json -o graph.html

# Filter by assembly name
unilyze -p ~/MyUnityProject -a App.Domain

# Filter by prefix
unilyze -p ~/MyUnityProject --prefix "App."

Subcommands

# Compare analysis results between two points in time (before/after)
unilyze diff <before.json> <after.json>
unilyze diff <before.json> <after.json> -o diff.json

# Hotspot analysis (git churn x complexity)
unilyze hotspot -p ~/MyUnityProject
unilyze hotspot -p ~/MyUnityProject --since 6.month -n 10

# Quality trend (time-series comparison)
unilyze trend <dir-of-jsons>
unilyze trend <dir-of-jsons> -o trend.json

# Show metric definitions and code smell thresholds
unilyze metrics

# Show JSON output field reference
unilyze schema

hotspot requires the git command and assumes the target path is a Git repository.

Options

Option Description Default
-p, --path Unity project root .
-i, --input Use existing JSON as input -
-o, --output Output destination (format inferred from extension) Open in browser
-f, --format Output format: html, json, sarif html
-a, --assembly Assembly name to analyze All assemblies
--prefix Filter prefix for asmdef names Auto-detected
--no-open Do not open browser after HTML generation false

Metrics

Metric Description Granularity
Cognitive Complexity SonarSource-compliant cognitive complexity Method
Cyclomatic Complexity McCabe 1976-compliant cyclomatic complexity Method
LCOM-HS Henderson-Sellers cohesion (0.0-1.0+) Type
CBO Coupling Between Objects (number of coupled types) Type
DIT Depth of Inheritance (inheritance chain depth) Type
Ca / Ce Afferent / Efferent Coupling Type
Instability Ce / (Ca + Ce) (0.0: stable - 1.0: unstable) Type
Maintainability Index Computed from Halstead Volume, CycCC, LoC (0-100) Method
Code Health Composite score (1.0: worst - 10.0: best) Type

Run unilyze metrics for detailed definitions and thresholds from the CLI. See also docs/metrics.md.

Code Smell Detection

Kind Warning Critical
GodClass lines >= 500 OR methods >= 20 lines >= 1000
LongMethod lines >= 80 OR CogCC >= 25 lines >= 150 OR CogCC >= 40
HighComplexity CycCC >= 15 OR CogCC >= 15 -
ExcessiveParameters params > 5 -
DeepNesting depth >= 4 depth >= 6
LowCohesion LCOM >= 0.8 -
HighCoupling CBO >= 15 -
LowMaintainability MI < 60 -
DeepInheritance DIT >= 5 -
CyclicDependency Cyclic dependencies between types/assemblies (Tarjan SCC) -

Output Formats

Format Use Case
html Visualize dependency graphs and metrics in browser
json Agent integration, programmatic use
sarif GitHub Code Scanning, IDE integration

The html output normally displays an interactive dependency graph. In environments where external graph assets cannot be loaded, it automatically falls back to a built-in report view showing type lists, dependencies, hotspots, cyclic dependencies, and assembly coupling.

Known Limitations

  • The interactive html graph loads Cytoscape scripts from CDN. In environments where these cannot be fetched, it falls back to a built-in offline report. This is by design.
  • Windows has not been tested. Environments not listed in this README are not yet guaranteed to work.

Analysis Levels

Analysis precision is maximized through a 3-level fallback based on project configuration:

Priority Source Information Obtained
1 .csproj / .sln DLL reference paths, preprocessor symbols, C# version
2 .asmdef + Unity DLL Unity Engine/Editor DLLs, package DLLs
3 SyntaxOnly SyntaxTree only (no SemanticModel)

When .csproj files exist, reference information is automatically obtained, improving accuracy of SemanticModel-based analysis (LCOM, CBO, DIT, bool &/| in CycCC, etc.). Without .csproj, DLLs are auto-resolved from .asmdef files and Unity installations. If neither is found, it operates with SyntaxTree only.

Projects without .asmdef files are also supported. The entire directory is analyzed as a single assembly.

Agent Workflow

Designed to drive quality improvement loops with coding agents:

unilyze (measure) -> identify issues -> fix -> unilyze diff (verify) -> confirm improvement

Install skills for your agent

# Claude Code
unilyze skills install --claude

# Multiple targets at once
unilyze skills install --claude --codex --cursor

# Global install (available across all projects)
unilyze skills install --claude --global

Supported targets: --claude, --codex, --cursor, --gemini, --windsurf

Skills provide structured workflows (/quality-audit, /refactor-loop) that guide agents through measure-fix-verify cycles.

Self-documenting CLI for agents

Agents can discover metrics and JSON schema without external docs:

unilyze metrics   # Metric definitions, CodeSmell thresholds
unilyze schema    # JSON output field reference (for jq queries)

Measure-fix-verify loop

# 1. Measure
unilyze -p ~/MyProject -f json -o /tmp/before.json

# 2. Agent fixes problem areas
# ...

# 3. Re-measure & verify improvement with diff
unilyze -p ~/MyProject -f json -o /tmp/after.json
unilyze diff /tmp/before.json /tmp/after.json

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.7.0 406 10/23/2026
0.6.1 355 7/30/2026
0.6.0 159 7/7/2026
0.5.3 170 6/16/2026
0.5.2 161 6/15/2026
0.5.1 145 6/14/2026
0.5.0 151 6/14/2026
0.4.1 148 6/13/2026
0.4.0 139 6/13/2026
0.3.0 146 6/8/2026
0.2.2 144 5/19/2026
0.2.1 176 3/27/2026
0.2.0 160 3/22/2026
0.1.9 168 3/17/2026
0.1.8 145 3/15/2026
0.1.7 145 3/15/2026
0.1.6 136 3/15/2026
0.1.5 143 3/15/2026
0.1.4 136 3/15/2026
0.1.3 144 3/15/2026
Loading failed