Skip to main content

hyena_dart 3.2.0 copy "hyena_dart: ^3.2.0" to clipboard
hyena_dart: ^3.2.0 copied to clipboard

A Flutter/Dart codebase analyzer for dead code detection and complexity metrics.

3.2.0 - 2026-11-21 #

Fixed #

  • Treat files with a leading generated-code header as generated: preserve their references without reporting their declarations or complexity. (#33)
  • Keep instance field initializer dependencies reachable when their class is instantiated, without retaining initializers of unused classes or unused static fields. (#34)
  • Honor pubspec_overrides.yaml workspace lists, including nested members and empty overrides, when discovering workspace packages. (#32)
  • Respect package language versions and per-file language overrides when computing complexity metrics instead of skipping valid older Dart syntax. (#35)
  • Do not report enhanced enum constructors as unused when invoked by reachable enum constants. (#30)
  • Keep const constructors used only as annotations, such as @Foo() or @Foo.named(), reachable when the annotated declaration is live. (#31)

3.1.0 - 2026-11-21 #

Added #

  • --fail-on-skipped on all analysis commands exits 2 if any file is skipped. (#23)
  • SARIF reports include invocation status and one warning notification per skipped file, with its reason and relative file location. (#23)
  • CLI JSON reports include schemaVersion: 1 and a published JSON Schema at schema/report.schema.json for single-package and workspace reports. (#21)
  • Page through all hyena_analyze MCP findings with offset, limit, and summary.nextOffset, including findings within a single file. (#25)
  • Apply CLI-written baselines with the MCP tool's workspace-relative baseline input; summaries report hidden findings in baselinedFindings and totals after suppression. (#25)

Changed #

  • Speed up complexity scans with nested functions by avoiding repeated AST walks. (#19)

Fixed #

  • Keep superclass constructors live when invoked by reachable constructors implicitly, through super(...), or through super. parameters. (#28)
  • Runs with --fail-on now exit 2 when every file is skipped, instead of passing a finding gate without analyzing any files. (#23)
  • Keep references from generated files when excluded by configuration, while continuing to omit their declarations from dead-code findings. (#20)
  • Keep enum constants live when referenced through the enum's values property. (#22)
  • Treat @pragma('vm:entry-point') declarations and their transitive dependencies as live by default, including forms with a second argument other than literal false. (#24)
  • Keep overloaded operators live when used through operator syntax, including compound assignments and increment/decrement expressions. (#26)
  • Keep getters and fields read only through object patterns (case Point(:final x), final Point(:x) = p, nested record destructuring) out of dead-code findings. (#29)

3.0.1 - 2026-11-21 #

Added #

  • GitHub Action: add uses: Chandram-Dutta/hyena_dart@v3.0.1 to a workflow to run Hyena, upload its SARIF report to GitHub code scanning, and see dead-code and complexity findings inline on pull requests. It supports working-directory, nested package paths, config and baseline files, fail-on (the report is uploaded before the step fails), and Flutter projects. See "GitHub code scanning" in the README.

Changed #

  • pubspec homepage and documentation point to https://hyenadart.onlychan.xyz
  • Tagged releases also create a GitHub release with notes from this changelog

Documentation #

  • Align the README and contributor docs with 3.0.0 behavior (skipped files, CLI flags, report formats, MCP)

3.0.0 - 2026-11-11 #

Breaking changes #

  • Dart SDK 3.11+ and analyzer 14. Hyena now depends on analyzer: ^14.0.0 (was ^8.4.1) and requires Dart SDK 3.11.0 or newer (was 3.10.3). Because Hyena is a dev dependency, other dev tools in the same project (code generators, custom lint plugins) must also accept analyzer 14.x, or pub get reports a version conflict.
  • Removed exports. package:hyena_dart/hyena_dart.dart no longer exports CLI wiring or internal path helpers. Code that imported these symbols from the public library must stop using them (or import package:hyena_dart/src/... at its own risk):
    • HyenaCommandRunner (from src/cli/cli_runner.dart)
    • BaseAnalysisCommand (from src/cli/cli_runner.dart)
    • AnalyzeCommand (from src/cli/cli_runner.dart)
    • DeadCodeCommand (from src/cli/cli_runner.dart)
    • ComplexityCommand (from src/cli/cli_runner.dart)
    • analysisRootForTarget (from src/models/analysis_path.dart)
    • relativeAnalysisPath (from src/models/analysis_path.dart)
    • relativeFindingPath (from src/models/analysis_path.dart)
  • Tool errors now exit 2 (may affect CI scripts). hyena_dart used to exit 1 both for findings and for tool errors. Tool errors now exit 2: a missing or invalid config or baseline file, a missing or unreadable target path, analysis failures that stop the whole run, and report write failures. Exit 1 now means only "findings tripped --fail-on". Usage errors still exit 64, and successful runs still exit 0.
  • Crashes now exit 2. Unexpected internal errors exit 2 with a message, where previously they crashed with Dart's unhandled-exception code 255.
  • hyena_mcp startup failures exit 2. hyena_mcp now exits 2 instead of 64 when the --root directory does not exist, and other startup failures also exit 2. Usage errors, such as omitting --root, still exit 64.
  • Files that fail to analyze no longer fail the run. A file that fails to resolve, has analysis or syntax errors, cannot be read, or throws during analysis is now skipped with a Warning: skipped <path>: <reason> line on stderr, and the run continues with its normal exit code. In 2.0.1 such a file aborted the run. Library callers no longer get a StateError from DeadCodeAnalyzer.analyze or a FormatException from ComplexityAnalyzer.analyze for such files; check skippedFiles on the reports instead. CI jobs should make sure generated code is up to date and can check stderr or the JSON skippedFiles arrays.

Changed #

  • Migrate to the analyzer 14 AST: class, enum, and extension-type names come from namePart, enum constants from body, and constructor locations no longer use the removed returnType
  • Stop passing the removed excludedPaths to AnalysisContextCollection; nested workspace packages are still excluded by Hyena's own file filtering

Added #

  • DeadCodeReport.skippedFiles and ComplexityReport.skippedFiles (list of SkippedFile with filePath and reason), plus an aggregated AnalysisResult.skippedFiles
  • JSON reports include a skippedFiles array (filePath, reason) in both the deadCode and complexity sections; existing fields are unchanged
  • The console report lists skipped files and their reasons in the dead code and complexity sections
  • MCP structured output adds an optional summary.skippedFiles count and an optional skippedFiles list (analysis, path, reason; at most 200 entries)
  • Optional resolveUnit (DeadCodeAnalyzer) and readSource (ComplexityAnalyzer) constructor hooks, mainly for testing failure handling
  • Document exit codes in the README ("Exit codes" section)

Fixed #

  • Dead-code analysis of Dart 3.12 source using private named parameters, which analyzer 8.4 could not resolve
  • A Dart file that fails to resolve, has analysis or syntax errors, cannot be read, or throws during analysis no longer aborts the whole dead-code or complexity run. Hyena skips the file, prints a Warning: skipped <path>: <reason> line to stderr, and keeps analyzing the rest of the target
  • Declarations in skipped files are not reported as dead code. Code that a resolvable-but-erroneous file references is still treated as used, so skipping it does not create false positives elsewhere
  • The MCP server returns normal results for targets containing such files instead of failing the request
  • Dead code analysis now collects references from generated files (.g.dart, .freezed.dart, .mocks.dart, including part files) instead of skipping them, so declarations used only by generated code (e.g. helpers called from _$UserFromJson, private freezed constructors, interfaces implemented by mocks) are no longer reported as unused. Declarations inside generated files are still never reported, stale generated files with errors no longer abort the run, and user exclude patterns still remove generated files entirely.

Documentation #

  • Add a library-level overview and API documentation for every exported type and member
  • Enable the public_member_api_docs lint so new public API must be documented
  • Update the package example to compute display paths with package:path instead of the removed helpers
  • Add README badges, an audience summary, a two-command quick try, and real sample output; move the compatibility note below the quickstart
  • Shrink the README logo from 4.8 MB to about 46 KB
  • Add a Migrating from 2.x to 3.0 README section, and remove generated-file suffix excludes from the sample config

Maintenance #

  • Add a frontend_server_client: ^4.0.0 dev-dependency floor so dart pub downgrade && dart test works on current SDKs
  • Give the CLI subprocess tests a longer timeout, since dart run now compiles the larger analyzer from source

2.0.1 - 2026-08-30 #

Fixed #

  • Escape source-controlled paths and symbol names in Markdown reports to prevent report markup injection
  • Reject extra CLI target paths and empty combined analyses instead of silently ignoring them
  • Report expected CLI usage, configuration, analysis, and filesystem failures without unhandled stack traces
  • Describe the MCP filesystem boundary accurately: targets are workspace-confined, while Dart may resolve SDK and dependency sources outside the workspace
  • Use project-relative paths in the package example

Security #

  • Pin GitHub Actions to reviewed commits and verify the downloaded Dart SDK used by orb setup
  • Add package dry-run validation to the release workflow

Maintenance #

  • Refresh compatible locked dependency versions

2.0.0 - 2026-08-30 #

Changed #

  • Report unused exported public declarations by default; reusable package APIs can be preserved with ignore_exports: true or --ignore-exports
  • Support only project-local dev-dependency execution, removing global executable mappings and global-activation instructions
  • Emit project- or workspace-relative paths in console, JSON, Markdown, and HTML reports, matching existing SARIF, baseline, and MCP behavior

Added #

  • Support --ignore-exports and --ignore-private on the combined analyze command

1.2.4 - 2026-08-30 #

Fixed #

  • Apply Dart analyzer context boundaries to complexity source discovery, preventing nested SDKs and tool-managed checkouts from being parsed as project source without hard-coded directory exclusions

1.2.3 - 2026-08-30 #

Fixed #

  • Normalize and absolutize analysis targets and discovered source paths before creating analyzer contexts, so current-directory and trailing-separator targets work reliably
  • Verify that each discovered source belongs to the selected analyzer context before resolving it, preventing nested tool worktrees from crashing analysis

1.2.2 - 2026-08-27 #

Added #

  • Add deterministic single-package and workspace performance corpora, structured timing and memory results, an advisory v1.2.1 baseline, and a manually triggered benchmark workflow
  • Add opt-in read-only benchmarking for an existing production repository without running its code or dependency setup
  • Publish pinned Melos, Flame, and Flutter packages benchmark results with methodology, limitations, and concrete review leads

Fixed #

  • Parse modern Dart dot-shorthand syntax and tolerate non-error dartdoc parser diagnostics in complexity analysis
  • Exclude .dart_tool and build artifacts from source analysis
  • Keep fields that implement inherited getters, and their initializer dependencies, reachable in dead-code analysis
  • Reject benchmark baseline comparisons when corpus metadata or correctness signatures differ
  • Prevent external benchmark output from being written inside the target, including through symlink aliases

1.2.1 - 2026-08-27 #

Added #

  • Add a Flutter-style workspace fixture plus Windows-native path, recursive glob, symlink-alias, and malformed-workspace regressions
  • Add normalized golden compatibility coverage for console, JSON, Markdown, HTML, and SARIF reports

Fixed #

  • Preserve resolved dead-code reachability across workspace package boundaries without conflating same-named declarations or references from unreachable callers

1.2.0 - 2026-08-27 #

Added #

  • Add --version to both executables and enforce runtime/package version consistency in CI and publishing
  • Analyze Dart workspaces package by package with nested/glob discovery, per-package configuration, package-scoped reports, and workspace-relative findings
  • Add configurable dead-code entry points and entry-point annotations for routes, generated callbacks, serializers, dependency injection, and plugin registrations

Fixed #

  • Keep workspace members out of parent scans so files are not double-counted or analyzed with the wrong package configuration
  • Preserve baselines, SARIF locations, and MCP summaries across package-scoped workspace results

1.1.2 - 2026-08-27 #

Added #

  • Add a stdio-only, workspace-confined MCP server with one read-only analysis tool
  • Add a repository-local agent skill for safe Hyena MCP and JSON CLI workflows

1.1.1 - 2026-08-27 #

Fixed #

  • Correct the minimum analyzer and glob constraints so supported lower-bound dependency resolution compiles and runs

CI #

  • Validate lower dependency bounds with static analysis and an end-to-end CLI smoke test

1.1.0 - 2026-08-27 #

Added #

  • Analyze individual Dart files as well as directories
  • Detect unused explicit constructors
  • Support hyena:ignore source suppressions for dead code and individual complexity rules
  • Add versioned finding baselines with stable, line-independent fingerprints
  • Add opt-in --fail-on exit codes for dead-code and complexity findings
  • Add SARIF 2.1 output for code-scanning integrations

Fixed #

  • Preserve public APIs from directly importable package libraries and library parts
  • Follow every conditional import and export branch
  • Recognize inherited member implementations without requiring an @override annotation
  • Conservatively retain unresolved dynamic member targets

1.0.1 - 2026-08-27 #

Fixed #

  • Honor configured complexity thresholds, dead-code settings, and target-project configuration without CLI defaults overriding YAML
  • Detect dead code through declaration reachability, including exported APIs, extensions, extension types, and their dependencies
  • Respect barrel export visibility and show/hide combinators
  • Report accurate one-based source locations and physical line totals
  • Analyze constructors, closures, modern control flow, and constructor initializer lists in their correct complexity scopes
  • Exclude nested closure bodies from outer-function metrics
  • Calculate token-based Halstead volume and a normalized maintainability index
  • Surface parse and resolution failures instead of silently omitting source files
  • Escape source-controlled content in HTML reports

1.0.0 - 2026-05-23 #

Added #

  • Initial release of Hyena Dart codebase analyzer
  • Dead code detection for unused classes, functions, methods, enums, variables, fields, and typedefs
  • Code complexity metrics including cyclomatic complexity, lines of code, nesting levels, parameter count, and maintainability index
  • Multiple output formats: Console (colored), JSON, Markdown, and HTML
  • CLI tool with three main commands: analyze, dead-code, and complexity
  • Configuration file support via hyena.yaml or analysis_options.yaml
  • Configurable exclusion patterns for generated files (.g.dart, .freezed.dart, etc.)
  • Comprehensive documentation and CLI reference
  • Unit tests for core models and configuration
  • AST-based analysis using Dart's official analyzer package
  • Export tracking for dead code detection accuracy
  • Progress indicators and detailed reporting
  • MIT License
0
likes
160
points
560
downloads

Documentation

Documentation
API reference

Publisher

verified publisheronlychan.xyz

Weekly Downloads

A Flutter/Dart codebase analyzer for dead code detection and complexity metrics.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#analyzer #dead-code #complexity #linter #cli

License

MIT (license)

Dependencies

analyzer, args, dart_mcp, glob, path, yaml

More

Packages that depend on hyena_dart