Pin it to the project
Add Hyena as a development dependency so local and CI runs use the same version.
dart pub add dev:hyena_dartStatic analysis for Dart + Flutter
Hyena resolves your Dart AST to trace declaration reachability, then measures function-level complexity. Run it from the terminal, emit a report, or call the analyzers from Dart.
v2.0.0 · current release · Dart SDK 3.10.3+
$ dart run hyena_dart analyze lib --no-color
HYENA CODE ANALYSIS REPORT
────────────────────────────────
Target: lib
DEAD CODE
Total declarations: 204
Unused entities: 0
✓ No dead code detected
COMPLEXITY
Files: 17
Functions: 251
Threshold violations: 5dart pub add dev:hyena_dartSafe AI / MCP
Introduced in v1.1.2
Run hyena_dart:hyena_mcp from the project that pins Hyena. --root . confines its one read-only tool to that project and relative Dart targets.
hyena_analyze(path, checks) returns schema-versioned findings.{
"mcpServers": {
"hyena": {
"command": "dart",
"cwd": "/absolute/path/to/project",
"args": [
"run",
"hyena_dart:hyena_mcp",
"--root",
"."
]
}
}
}hyena_analyze({
"path": "lib",
"checks": "both"
})The short path
Use the defaults first. Add a config only when generated files, reusable public APIs, or your team's complexity limits need different treatment.
Add Hyena as a development dependency so local and CI runs use the same version.
dart pub add dev:hyena_dartDead-code analysis needs analyzer resolution for every included file.
dart pub getAnalyze the package, a subdirectory, or one Dart file while iterating.
dart run hyena_dart analyze .Analysis surface
Dead-code analysis follows resolved references from roots. Complexity analysis parses each function, method, constructor, and closure into a small set of reviewable metrics.
How analysis worksReports declarations that cannot be reached from entry points, inherited implementations, top-level references, and configured roots.
Measures control-flow paths, nesting, parameters, physical LOC, Halstead volume, and a normalized maintainability index.
Custom glob patterns apply on top of built-in exclusions for generated outputs and build directories.
Adoption controls
Source suppressions and a versioned baseline are applied before reporting and exit-code policy, so existing debt does not need a broad exclusion.
Keep an intentional exception next to the code and scope it to a declaration or rule.
// hyena:ignore dead-codeCommit stable, line-independent fingerprints for findings the project accepts today.
--write-baseline=hyena-baseline.jsonApply the baseline, then return exit code 1 only for the selected finding categories.
--fail-on=dead-code,complexityOutput
Every command can write to stdout or a file. The selected reporter changes presentation, not the analysis itself.
Compact summaries and the first 20 findings, with optional ANSI color.
Structured metrics for custom policies and SARIF 2.1 for code-scanning systems.
Tables and collapsible file sections that fit issue and pull-request workflows.
A standalone report with summary cards and detailed violation tables.
Operational notes
Hyena is a focused analyzer, not a replacement for the Dart compiler, lints, tests, or runtime coverage.
ignore_exports: true.Documentation