gomplekity

command module
v0.0.0-...-f008c77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README ΒΆ

🌳 Gomplekity

Overview

Gomplekity analyzes the cyclomatic complexity of your Go code and generates a beautiful tree visualization.

The leaf colors represent different complexity levels, and the color distribution reflects the proportion of functions at each complexity level.

Not a serious tool. A simple Go complexity visualizer that turns your code complexity into a tree with colored leaves.

Example Tree

  • 🟒 Green: Low complexity (0-9)
  • 🟑 Yellow: Medium complexity (10-14)
  • πŸ”΄ Red: High complexity (15-19)
  • 🟀 Brown: Critical complexity (20+)

Installation

go install github.com/masakurapa/gomplekity@latest

Usage

Basic usage
# Analyze current directory (outputs PNG by default)
gomplekity

# Analyze specific directory
gomplekity -dir ./src

# Custom output file
gomplekity -output my_project.png

# Generate SVG instead of PNG
gomplekity -output my_project.svg -svg
Advanced options
# Show detailed analysis
gomplekity -verbose

# Custom complexity thresholds
gomplekity -medium 8 -high 12 -critical 16

# All options with PNG output
gomplekity -dir ./src -output project.png -medium 8 -high 12 -critical 16 -verbose

# All options with SVG output
gomplekity -dir ./src -output project.svg -svg -medium 8 -high 12 -critical 16 -verbose
Options
-dir string         Directory to analyze (default ".")
-output string      Output file path (default "complexity_tree.png")
-medium int         Medium complexity threshold (default 10)
-high int           High complexity threshold (default 15)
-critical int       Critical complexity threshold (default 20)
-verbose            Show detailed complexity analysis
-svg                Generate SVG output instead of PNG
-help               Show help message
Sample output
βœ… Tree visualization saved to: complexity_tree.png
πŸ“Š Color distribution: 🟒76.9% 🟑15.4% πŸ”΄7.7% 🟀0.0%

Name Origin

"Gomplekity" combines:

  • Go - The Go programming language
  • Complexity - Code complexity
  • 木 (ki) - Japanese word for "tree"

But it might help you understand your code complexity in a fun way! 🌳✨

License

This project uses github.com/fzipp/gocyclo which is licensed under BSD-3-Clause.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 捒网址