Skip to content

similarity-go

Find duplicate and similar code patterns in your Go codebase with powerful AST analysis

similarity-go is a powerful CLI tool designed to help Go developers identify duplicate and similar code patterns in their codebases. By leveraging Go’s Abstract Syntax Tree (AST) analysis, it provides accurate and meaningful similarity detection that goes beyond simple text matching.

🚀 Fast Analysis

Built with Go’s native AST parsing for lightning-fast code analysis

🎯 Accurate Detection

Uses sophisticated algorithms to detect semantic similarities, not just textual matches

⚙️ Configurable

Customize similarity thresholds and ignore patterns to fit your needs

📊 Rich Output

Multiple output formats including JSON, YAML, and human-readable reports

Try similarity-go directly in your browser:

🚀 Interactive Demo

Experience similarity-go's AST analysis in real-time

Lines: 0
🤖
Click "Analyze Code" to see AST-based similarity analysis
💡

Demo Note: This is a simulated analysis for demonstration. The actual similarity-go CLI provides:

  • • Real AST parsing and structural analysis
  • • Support for entire Go projects and modules
  • • Advanced similarity algorithms with configurable thresholds
  • • JSON, YAML, and detailed console output formats

Unlike simple text-based tools, similarity-go analyzes the structure of your code using Go’s Abstract Syntax Tree. This means it can detect functionally similar code even when variable names, comments, or formatting differ.

Fine-tune the detection sensitivity to match your project’s needs. Set different thresholds for different types of similarities.

Get results in the format that works best for your workflow:

  • Human-readable console output
  • JSON for programmatic processing
  • YAML for configuration management
  • Integration with popular CI/CD systems

Built for speed with parallel processing and efficient memory usage, even on large codebases.

⚡ Performance Benchmarks

similarity-go performance across different codebase sizes

Benchmarked on: Intel i7-12700K, 32GB RAM, NVMe SSD

⏱️ Execution Time Analysis

🏃‍♂️
FAST
Small Project
~1,000 lines
0.15s
🚶‍♂️
GOOD
Medium Project
~10K lines
1.2s
🏃‍♀️
SOLID
Large Project
~100K lines
8.7s
🏢
SCALE
Enterprise
~1M lines
45s
💾
Memory Usage
~25MB
Peak Usage
Low Efficient & Scalable
CPU Utilization
80%
Efficiency
Multi-core optimized Parallel Processing
🎯
Accuracy
95%
Precision Rate
AST-based Analysis High Precision

🚀 Performance Features

What makes similarity-go fast and efficient

Parallel Processing
Worker pools maximize CPU utilization across all cores
Intelligent Caching
Smart caching system reduces redundant AST operations
Memory Efficient
Optimized AST traversal with minimal memory footprint
Enterprise Ready
Scales efficiently for large codebases and CI/CD pipelines

Ready to start finding similarities in your Go code?

  1. Install similarity-go on your system
  2. Follow our Quick Start Guide to run your first analysis
  3. Explore the API Reference for advanced usage