widget_analyser 0.2.0
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
analyzerto12.1.0and updated AST usage for that release (ClassDeclaration.body/BlockClassBody, constructor formal parameter lists). - Shortened the
pubspec.yamldescription to satisfy pub.dev field limits.
Added #
- Expanded dartdoc on the public library API (config, models, reporters).
Fixed #
- Tests and helpers that assumed
ClassDeclaration.membersnow read members fromClassDeclaration.bodywhen it is aBlockClassBody.
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, andState. - 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, anderrorseverity. - 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_analysersection, withdart_code_metricsfallback). - 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).