code complexity & repetition analysis tool
1# Introduction
2
3**Mccabre** language-agnostic code complexity and clone detection tool designed to help developers identify problematic & repeated code patterns.
4
5## Features
6
7- **Cyclomatic Complexity Analysis**: Measure control-flow complexity using McCabe's algorithm
8- **Lines of Code Metrics**: Count physical, logical, comment, and blank lines
9- **Clone Detection**: Find duplicated code using Rabin-Karp rolling hash
10- **Multi-Language Support**: Rust, JavaScript/TypeScript, Go, Java, and C++
11- **Gitignore Aware**: Automatically respects .gitignore files
12- **Multiple Output Formats**: Beautiful terminal output or JSON
13
14## Design Philosophy
15
16Mccabre prioritizes:
17
181. **Speed**: Linear or near-linear performance through tokenization instead of full parsing
192. **Simplicity**: Easy to use with sensible defaults
203. **Actionability**: Clear, color-coded output highlighting issues
214. **Extensibility**: Modular design allowing future enhancements
22
23## Limitations
24
25- **Token-based**: Function detection is heuristic-based and may miss some functions
26- **Language Support**: Currently supports C-style languages; Python coming soon
27- **Clone Detection**: Finds exact token matches, not semantic equivalence (yet)
28
29See the [Quick Start](./quickstart.md) guide to begin using Mccabre.