Analyzers Overview
Omen ships with 20 analyzers that cover structural quality, defect risk, historical patterns, dependency health, and specialized concerns. Each analyzer is available as a top-level subcommand and can be run independently or as part of a full suite via omen all.
All analyzers parse source code through tree-sitter grammars, producing syntax-aware results rather than regex-based approximations. Output is available as formatted tables (default) or JSON (-f json).
Complexity & Quality
Analyzers that measure the structural and cognitive properties of the code itself.
| Analyzer | Command | What It Measures |
|---|---|---|
| Complexity | omen complexity | Cyclomatic and cognitive complexity per function, nesting depth |
| CK Metrics (Cohesion) | omen cohesion | Chidamber-Kemerer OO metrics: WMC, CBO, RFC, LCOM4, DIT, NOC |
| Technical Debt Gradient | omen tdg | Composite file health score (0-100) across 9 weighted dimensions |
| Architectural Smells | omen smells | God classes, data clumps, feature envy, cyclic dependencies |
Risk & Defects
Analyzers that predict where bugs are likely to appear based on code structure, change patterns, and historical defect signals.
| Analyzer | Command | What It Measures |
|---|---|---|
| Defect Prediction | omen defect | Probability of defects using complexity, churn, and ownership signals |
| Change Risk | omen changes | Risk score for recent modifications based on size, complexity delta, and file history |
| Diff Analysis | omen diff | Structural analysis of uncommitted or branch changes |
| Hotspots | omen hotspot | Files with both high complexity and high change frequency |
History & Ownership
Analyzers that use Git history to surface patterns invisible in a single snapshot.
| Analyzer | Command | What It Measures |
|---|---|---|
| Churn | omen churn | Change frequency and volume per file over time |
| Temporal Coupling | omen temporal | Files that change together, suggesting hidden dependencies |
| Ownership | omen ownership | Contributor distribution per file, bus factor |
Structure & Dependencies
Analyzers that examine relationships between code units: imports, call graphs, duplication, and reachability.
| Analyzer | Command | What It Measures |
|---|---|---|
| Dependency Graph | omen graph | Import/dependency relationships, coupling metrics, cycles |
| Dead Code | omen deadcode | Unreachable functions, unused exports, orphaned modules |
| Code Clones | omen clones | Duplicated code blocks (Type 1, 2, and 3 clones) |
| Repository Map | omen repomap | Structural map of modules, symbols, and relationships |
Specialized
Analyzers focused on specific concerns that cut across the categories above.
| Analyzer | Command | What It Measures |
|---|---|---|
| SATD Detection | omen satd | Self-Admitted Technical Debt in comments (TODO, FIXME, HACK, etc.) |
| Stubs Detection | omen stubs | Incomplete/placeholder implementations (todo!(), elided bodies, empty bodies) |
| Feature Flags | omen flags | Feature flag usage, stale flags, flag-related complexity |
| Mutation Testing | omen mutation | Test suite effectiveness by injecting controlled code mutations |
Agent-Facing Commands
Beyond the analyzers above, Omen ships commands designed specifically for LLM/agent workflows rather than human review:
| Command | What It Does |
|---|---|
omen context | Agent-oriented repository overview and navigation hints, budgeted with --max-tokens |
omen outline | Token-cheap map of a file's imports, classes, and top-level functions |
omen impact <symbol> | Blast-radius analysis: transitive callers and callees of a symbol |
omen symbol <symbol> | One-call symbol report: source, location, callers/callees, and complexity |
omen search | Semantic (natural-language) symbol search -- search index and search query |
These are also exposed as MCP tools (context, outline, impact, get_symbol, semantic_search) -- see MCP Server.
Running Multiple Analyzers
Run all analyzers at once:
omen all
Run a subset by chaining commands:
omen complexity && omen cohesion && omen smells
All commands accept the same global flags:
| Flag | Description |
|---|---|
-p <path> | Target path (local directory, file, or owner/repo for remote) |
-f json | JSON output |
--compact | Minify JSON output to a single line |
--language <lang> | Filter to a specific language |
-c, --config <path> | Path to a configuration file |
-e, --exclude <glob> | Exclude a glob pattern from analysis (repeatable) |
--top N / --offset N | Paginate results |