A web-based tool for analyzing and visualizing various code complexity metrics in Go source files.
- Runs entirely in your browser
- No server required
- Perfect for quick analysis
- Available in the live demo
- Full feature set
- Handles larger files
- Better performance
- Requires local setup
- Cyclomatic Complexity (McCabe): Measures the number of linearly independent paths through code
- Cognitive Complexity: Measures how difficult it is to understand the code's control flow
- Halstead Metrics:
- Volume: Measures the size of the implementation
- Difficulty: Indicates how hard the code is to understand
- Effort: Estimates the effort required to maintain the code
- Maintainability Index: A composite metric indicating overall maintainability (0-100 scale)
- Lines of Code: Physical lines of code per function
- Clone the repository:
git clone https://github.com/aman/code-complexity-viz
cd code-complexity-viz
- Install dependencies:
go mod tidy
- Run the server:
go run main.go
- Open
http://localhost:8080
in your browser
- Upload a Go source file using the web interface
- Click "Analyze" to process the file
- View the visualization of complexity metrics
- Use the dropdown to switch between different metrics
- Hover over bars to see detailed metrics for each function
- Maximum file size: 5MB
- Only analyzes
.go
files - Functions must be syntactically valid Go code
This project is licensed under the MIT License - see the LICENSE file for details.