Documentation
Hyena is a Dart package and CLI for two related checks:
- Dead code: resolve declarations and references, build a reachability graph, and report declarations that have no path from a root.
- Complexity: parse functions, methods, constructors, and closures and calculate control-flow and size metrics.
It analyzes a Dart file or recursively scans a directory and can write console, JSON, Markdown, standalone HTML, or SARIF 2.1 output.
Choose a path
Section titled “Choose a path”| Goal | Start here |
|---|---|
| Run Hyena once | Getting started |
| Pick an installation model | Installation |
| Upgrade an existing v1.x project | Migrate to v2.0 |
| Look up a command or flag | CLI reference |
| Exclude files or change thresholds | Configuration |
| Analyze a Dart workspace or monorepo | Workspaces and monorepos |
| Preserve framework or generated entry roots | Framework entry roots |
| Understand a finding | Dead-code analysis or complexity analysis |
| Consume or publish a report | Report formats |
| Use results in automation | CI and automation |
| Connect an AI client | Safe AI and MCP |
| Call the analyzers from Dart | Library API |
| Contribute to Hyena | Architecture and development |
Defaults at a glance
Section titled “Defaults at a glance”hyena: exclude: [] complexity: cyclomatic_threshold: 20 max_nesting: 5 max_parameters: 6 dead_code: ignore_main: true ignore_exports: false ignore_private: false entry_points: [] entry_point_annotations: []Hyena also excludes *.g.dart, *.freezed.dart, *.mocks.dart, and any path containing a directory segment named generated, even when they are not listed in exclude.
Available in v2.0.0
Section titled “Available in v2.0.0”Hyena Dart v2.0.0 moves to project-local installation and execution, reports unused public and private declarations by default, and makes console, JSON, Markdown, and HTML paths consistently relative to the package or workspace root.
Existing v1.x projects should read Migrating from v1.x to v2.0 before upgrading. Existing baseline fingerprints remain valid; SARIF, baseline, and MCP paths were already relative in v1.x.
Fixed in v1.2.1
Section titled “Fixed in v1.2.1”Hyena Dart 1.2.1:
- joins dead-code reachability across workspace package boundaries, preserving the exact resolved declaration while ignoring references that occur only inside unreachable callers; and
- accepts native Windows separators in explicit and glob workspace entries.
Available in v1.2.0
Section titled “Available in v1.2.0”Hyena Dart 1.2.0 adds:
- CLI and MCP version output, with release checks that keep runtime output aligned with the package version;
- package-scoped Dart workspace analysis with workspace-relative findings; and
- configured declaration and annotation entry roots for framework- or generated-code reachability.
