Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/content/docs/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ See: [GitHub Integration](/integrations/github/)
## Code Analysis

```bash
roborev analyze test-fixtures internal/*_test.go # Run built-in analysis
roborev analyze refactor --fix ./... # Analyze and auto-fix
roborev analyze duplication ./... # Find duplication
roborev analyze refactor --fix *.go # Suggest and apply refactors
roborev analyze complexity --per-file src/*.go # One job per file
roborev analyze test-fixtures internal/*_test.go # Find test helper opportunities
roborev analyze refactor --branch # Analyze changed files on branch
roborev analyze refactor --branch=feature-xyz # Analyze a specific branch
roborev analyze --list # List analysis types
Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/guides/assisted-refactoring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Seven built-in analysis types target common refactoring concerns:

| Type | Description |
|------|-------------|
| `test-fixtures` | Find test fixture and helper opportunities to reduce duplication |
| `duplication` | Find code duplication across files |
| `refactor` | Suggest refactoring opportunities |
| `complexity` | Analyze complexity and suggest simplifications |
| `api-design` | Review API consistency and design patterns |
| `dead-code` | Find unused exports and unreachable code |
| `architecture` | Review architectural patterns and structure |
| `duplication` | Finds exact and structural code duplication across files and suggests consolidation opportunities. |
| `refactor` | Identifies code smells like long functions, complex conditionals, poor naming, and tight coupling. |
| `complexity` | Looks for complex functions, deep nesting, and large conditionals, then suggests simplifications. |
| `test-fixtures` | Finds repeated test setup, duplicated mocks, and similar assertion sequences across test files. |
| `api-design` | Reviews public API surface for naming consistency, parameter ordering, and error handling patterns. |
| `dead-code` | Finds unused exports, unreachable code paths, and stale commented-out code. |
| `architecture` | Evaluates package organization, dependency flow, separation of concerns, and layering violations. |

List available types with `roborev analyze --list`, or preview a prompt template with `roborev analyze --show-prompt <type>`. If you have shell completions enabled, `roborev analyze <TAB>` will suggest analysis types with descriptions.

Expand Down