Analyzers Overview
Omen ships with 19 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.) |
| Feature Flags | omen flags | Feature flag usage, stale flags, flag-related complexity |
| Mutation Testing | omen mutation | Test suite effectiveness by injecting controlled code mutations |
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 |
--language <lang> | Filter to a specific language |
--config <path> | Path to omen.toml configuration file |