code complexity & repetition analysis tool
1# Quick Start
2
3This guide will get you analyzing code in minutes.
4
5## Basic Usage
6
7### Analyze Everything
8
9Run a full analysis on a directory:
10
11```bash
12mccabre analyze ./src
13```
14
15This will show:
16
17- Cyclomatic complexity per file
18- Lines of code metrics
19- Detected code clones
20
21### Complexity Only
22
23To check only complexity metrics:
24
25```bash
26mccabre complexity ./src
27```
28
29### Clone Detection Only
30
31To find duplicated code:
32
33```bash
34mccabre clones ./src
35```
36
37## Understanding the Output
38
39### Terminal Output
40
41Mccabre uses colors to highlight issues:
42
43- **Green**: Low complexity (1-10)
44- **Yellow**: Moderate complexity (11-20)
45- **Red**: High complexity (21+)
46
47Example output:
48
49```text
50================================================================================
51MCCABRE CODE ANALYSIS REPORT
52================================================================================
53
54SUMMARY
55--------------------------------------------------------------------------------
56Total files analyzed: 5
57Total physical LOC: 450
58Total logical LOC: 320
59Average complexity: 8.50
60Maximum complexity: 18
61High complexity files: 2
62Clone groups detected: 3
63
64FILE METRICS
65--------------------------------------------------------------------------------
66FILE: src/utils.rs
67 Cyclomatic Complexity: 5 (low)
68 Physical LOC: 45
69 Logical LOC: 32
70```
71
72### JSON
73
74```bash
75mccabre analyze ./src --json > report.json
76```
77
78## Next Steps
79
80- Learn about [Cyclomatic Complexity](./cyclomatic-complexity.md)
81- Understand [Clone Detection](./clone-detection.md)
82- Configure [thresholds](./configuration.md)
83- See more [examples](./examples.md)