amanv8060/code-complexity-viz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A web-based tool for analyzing and visualizing various code complexity metrics in Go source files.

🔗 Try the Live Demo

  • 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
  1. Clone the repository:
git clone https://.com/aman/code-complexity-viz
cd code-complexity-viz
  1. Install dependencies:
go mod tidy
  1. Run the server:
go run main.go
  1. Open http://localhost:8080 in your browser
  1. Upload a Go source file using the web interface
  2. Click "Analyze" to process the file
  3. View the visualization of complexity metrics
  4. Use the dropdown to switch between different metrics
  5. 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.

License: MIT

About

A simple tool to analyzing and visualizing code complexity metrics in go.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published