widget_analyser 0.2.0 copy "widget_analyser: ^0.2.0" to clipboard
widget_analyser: ^0.2.0 copied to clipboard

Offline Flutter widget analyzer: complexity, nesting, and quality reports (console, JSON, HTML) with optional CI gates.

Changelog #

All notable changes to this project will be documented in this file.

The format follows Keep a Changelog. This project adheres to Semantic Versioning.

0.2.0 - 2026-05-13 #

Changed #

  • Updated dependency on analyzer to 12.1.0 and updated AST usage for that release (ClassDeclaration.body / BlockClassBody, constructor formal parameter lists).
  • Shortened the pubspec.yaml description to satisfy pub.dev field limits.

Added #

  • Expanded dartdoc on the public library API (config, models, reporters).

Fixed #

  • Tests and helpers that assumed ClassDeclaration.members now read members from ClassDeclaration.body when it is a BlockClassBody.

0.1.0 - 2026-05-13 #

Added #

  • Initial public release of flutter_widget_analyzer (CLI: widget_analyser).
  • Recursive Dart file scanner using the Dart analyzer AST.
  • Widget discovery for classes extending StatelessWidget, StatefulWidget, and State.
  • Six build-method metrics:
    • Cyclomatic complexity
    • Maximum nesting level (with deepest path)
    • Number of constructor parameters
    • Source lines of code (SLOC)
    • Build method lines (BML)
    • Number of used widgets
  • Configurable per-metric thresholds and weights.
  • Three-grade quality classification: high, medium, low.
  • Per-metric violations at info, warning, and error severity.
  • Widget usage graph connecting widgets inside the scanned project.
  • Token-based structural similarity detection (disabled by default).
  • Clone classification: Type-1, Type-2, Type-3.
  • Three output reporters: console, json, html.
  • Configuration loading from analysis_options.yaml (widget_analyser section, with dart_code_metrics fallback).
  • CLI flags: --reporter, --output-dir, --show-similarity, --threshold, --report-all, --root-folder, --exclude, --print-config, --sdk-path.
  • Exit codes: 0 (clean), 1 (low-quality widgets found), 2 (error).
5
likes
150
points
180
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Offline Flutter widget analyzer: complexity, nesting, and quality reports (console, JSON, HTML) with optional CI gates.

Repository (GitHub)
View/report issues

Topics

#flutter #widget #static-analysis #cli

License

MIT (license)

Dependencies

analyzer, args, glob, path, yaml

More

Packages that depend on widget_analyser