fcheck 0.9.11
fcheck: ^0.9.11 copied to clipboard
A CLI tool for analyzing Flutter and Dart code quality, checking project metrics, comment ratios, class organization, hardcoded strings, and source sorting validation.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.9.11 - 2026-02-16 #
Added #
- ๐ Enhanced Metrics Analyzer: New
MetricsAnalyzerclass with scoring logic, focus area detection, and compliance score calculation. - ๐ App Strings Analysis: New
AppStringsclass to extract and analyze application string constants for better code understanding. - ๐งช Improved Test Performance: Optimized test execution with faster test setup and teardown.
Changed #
- ๐ฅ๏ธ Console Layer Violations: Improved console reporting for layer folder violations with detailed violation information.
- ๐ง Hardcoded Strings Logic: Improved hardcoded string detection to also work for Dart CLI applications (not just Flutter).
- ๐ ๏ธ Publish Script: Updated
tool/publish.shto use Flutter test instead of Dart test for better compatibility. - โ Code Coverage: Increased test coverage to 87%.
0.9.10 - 2026-02-12 #
0.9.9 - 2026-02-12 #
Added #
- ๐ฏ Added a deterministic compliance scorecard with overall score, focus area, and suggested next investment area.
- ๐ Included compliance score details in JSON output (
summary.complianceScoreandcomplianceblock). - ๐ Added
--help-scoreCLI flag to show compliance scoring guidance.
Changed #
- ๐ฅ๏ธ Refined CLI console output layout to include a scorecard section and a denser dashboard summary.
- โ Expanded scoring-focused CLI and metrics test coverage.
Fixed #
- ๐ Corrected the dashboard label from
ComentstoComments.
0.9.8 - 2026-02-10 #
Added #
- ๐ Added
--help-ignoreCLI flag to show per-analyzer ignore directives and.fcheckignore setup guidance.
Changed #
- โป๏ธ Reused layers analysis results from the main analysis pass when generating graph outputs, instead of running a second layers-analysis traversal.
Fixed #
- โก Removed redundant CLI layers-analysis work during regular runs, reducing unnecessary overhead while preserving output behavior.
0.9.7 - 2026-02-10 #
Added #
- ๐งฉ Shared dependency URI utilities for consistent project import/export resolution across analyzers.
Changed #
- ๐ฅ๏ธ Improved console list formatting for issue lines and duplicate-code alignment.
- ๐ง Refactored analyzer, graph, and config internals to remove duplicated logic and keep behavior consistent.
Fixed #
- ๐งญ Project metadata resolution now correctly infers package name/version/type when analyzing from folders without a root
pubspec.yaml, and returnsunknownfor ambiguous multi-pubspec workspaces. - โ Updated duplicate-code output test expectations after formatting improvements.
0.9.6 - 2026-02-10 #
Added #
- ๐งฌ Code Duplication Detection
- Duplicate-code analysis for similar executable blocks (functions/methods/constructors) using normalized token comparison.
- Added file-level ignore support with
// ignore: fcheck_duplicate_code. - Support for
.fcheckoptions forsimilarity_threshold,min_tokens, andmin_non_empty_lines.
Changed #
- README positioning as an 8-in-1 deterministic workflow.
Fixed #
- removed remaining magic-number literals in duplicate-code analyzer utilities by introducing named constants
0.9.4 - 2026-02-09 #
Added #
- โ Added more test, code coverage is now at 81%
Changed #
- ๐งญ Layers Analyzer now runs through the unified single directory pass for more consistent dependency analysis.
- ๐ Updated
RULES_LAYERS.mdguidance to match the latest layers analysis behavior. - ๐ฅ๏ธ Refactored CLI console input/output into focused modules and simplified output rendering paths.
- ๐จ SVG graph exports now use adaptive text sizing to keep labels and titles readable across different graph densities.
0.9.3 - 2026-02-08 #
0.9.2 - 2026-02-08 #
Fixed #
- ๐งฐ Dead Code Analyzer: Treat generic class declarations (e.g.
class Box<T>) as their base class name so usages likeBox<int>no longer get flagged as dead classes.
0.9.1 - 2026-02-08 #
Fixed #
- ๐งฐ Dead Code Analyzer: Avoid flagging constructor field parameters (
this.foo) as unused when they initialize class properties. - ๐งฉ Dead Code Analyzer: Avoid flagging parameters in
@overridemethods or abstract/external signatures with empty bodies.
0.9.0 - 2026-02-08 #
Added #
- ๐งน Dead Code Analyzer: Detects dead files, unused top-level classes/functions, and unused local variables using dependency reachability and symbol usage tracking.
- ๐ซ Dead Code Ignore: New
// ignore: fcheck_dead_codedirective for file-level and node-level suppression. - ๐ Rules: Added
RULES_DEAD_CODE.mddocumentation.
Changed #
- ๐งฉ Layers Dependency Graph: Conditional imports/exports (
if (dart.library...)) are now included in dependency resolution. - ๐ Metrics Output: Added dead code counts and issue lists to CLI and JSON reports.
0.8.6 - 2026-02-07 #
0.8.5 - 2026-02-06 #
Changed #
- ๐ Secrets Detection: Generic secrets now extract assignment values (including triple-quoted strings) and apply entropy/length checks to the value, reducing false positives on full-line scans. GH https://github.com/vteam-com/fCheck/issues/2
- ๐งพ CLI Output: Standardized status markers (
[โ],[!],[โ]) and clarified report messaging, including explicit secrets counts and always showing excluded file counts. - ๐ Docs: Updated rules and comments.
Removed #
- ๐งน Dead Code: Dropped legacy per-analyzer classes now superseded by the unified delegate-based analyzer runner.
0.8.4 - 2026-02-06 #
Added #
- ๐ Rules: Added per-domain rule documents for:
- hardcoded strings,
- magic numbers,
- secrets,
- code sorting,
- layers
Changed #
- ๐ง Hardcoded String Detection: Improved Flutter vs Dart project handling to make string detection rules project-aware
- ๐งน Analyzer Refactor: Reduced duplication across analyzers and utilities.
0.8.3 - 2026-02-04 #
Added #
- ๐ Hidden Folder Filtering: Automatically exclude files in hidden directories (starting with '.') from analysis
- ๐ Excluded Files Listing: New
--excluded/-xCLI flag to list all excluded files and directories - ๐ Comprehensive Exclusion Reporting: Display excluded Dart files, non-Dart files, and directories separately
- ๐ฏ JSON Support for Exclusions: Full JSON output support for excluded files listing
- ๐ Enhanced Documentation: Updated README.md with comprehensive documentation for excluded files functionality
Changed #
- โก Unified Directory Scanning: Enhanced
scanDirectorymethod to return excluded file/folder counts in addition to regular metrics - ๐๏ธ File Enumeration Logic: Updated
listDartFilesmethod to skip hidden directories consistently - ๐ Performance Optimization: Maintained 67-72% performance improvement while adding new exclusion tracking
0.8.2 - 2026-02-03 #
Changed #
- ๐ Clarified the README "Magic Numbers" guidance so it now explains the new definition, outlines when literals are allowed (descriptive const/static/final declarations and annotations/const expressions), and shows how to fix detections by replacing inline literals with named constants before referencing the opt-out directive.
0.8.1 - 2026-02-02 #
Added #
- โฑ๏ธ Execution Timing: Added elapsed time display in the footer showing how long the analysis took to run
- ๐ Performance Visibility: Footer now shows "fCheck completed (X.XXs)" to help users track analysis performance
- ๐ฏ JSON Compatibility: Timing display is automatically suppressed in JSON output mode to maintain clean format
0.8.0 - 2026-02-02 #
โก Major Performance Optimization #
- ๐ Unified Analysis Architecture: Implemented single-pass file traversal with delegate pattern, eliminating redundant file operations and AST parsing
- ๐ 67-77% Performance Improvement: Analysis now runs 67-77% faster by performing one file discovery and one AST parse per file shared across all analyzers
- ๐ Delegate Pattern: All analyzers (HardcodedString, MagicNumber, SourceSort, Layers, Secrets) now work from shared parsed file context
- ๐ฏ Zero Breaking Changes: All existing functionality preserved with dramatic performance improvements
๐๏ธ Architecture Refactoring #
- ๐ Reorganized Analyzer Structure: Moved all analyzers to
src/analyzers/directory for better organization - ๐ง AnalyzerRunner: New unified analysis engine replaces individual analyzer traversals
- ๐ AnalysisFileContext: Shared file context eliminates redundant I/O operations
- ๐จ Cleaner Codebase: Removed old individual analyzer strategy, fully migrated to unified approach
๐ Secret Detection #
- ๐ก๏ธ Advanced Secret Analyzer: Comprehensive secret detection rules
- ๐ Multiple Secret Types: AWS keys, GitHub PATs, Stripe keys, Bearer tokens, Private keys, Email PII, High entropy strings
- ๐ Entropy-Based Detection: Advanced entropy calculation for unknown secret patterns
- ๐ฏ Improved Accuracy: Better false positive reduction with configurable thresholds
๐งน Code Quality Improvements #
- โ One Class Per File: Fixed violations in analyzer files by proper separation
- ๐ Documentation: Added comprehensive documentation for all new unified analysis components
Changed #
- โก Default Analysis Method:
analyze()now uses unified high-performance approach automatically - ๐๏ธ File Organization: Restructured analyzer directories for better maintainability
- ๐ Result Processing: Optimized result aggregation with type-safe handling
0.7.3 - 2026-02-01 #
Added #
- ๐ Enhanced pubspec.yaml Detection: Implemented parent directory traversal to find pubspec.yaml when analyzing from subdirectories, ensuring project name and version are always available regardless of analysis starting point
- ๐ Improved SVG Folder Display: Enhanced folder-based SVG visualization to show project name, version, and input folder information instead of generic "." root folder
- ๐จ Smart Folder Title Formatting: Implemented intelligent title display - shows only "Project vVersion" when folder name matches project name, or multi-line format "Folder\nProject vVersion" when they differ
Changed #
- ๐ Folder Name Extraction: Improved folder name detection logic using proper path handling to ensure accurate folder names in SVG outputs
- ๐ฏ SVG Text Rendering: Enhanced SVG text rendering with proper multi-line support using
<tspan>elements for better visual hierarchy
0.7.2 - 2026-01-31 #
Changed #
- ๐ก๏ธ Default Localization Filtering: Automatically hide generated localization files (
app_localizations_*.dart) from analysis and dependency graphs by default while keeping the main entry point to avoid cyclic dependency noise. - ๐งน Code Cleanup: Removed magic number violations across the codebase by introducing named constants for better maintainability.
0.7.1 - 2026-01-31 #
Added #
- ๐จ SVG Style Improvements: Enhanced CSS styles for SVG exports
- ๐ท๏ธ Badge Tooltips: Improved tooltip text for better clarity
- ๐ Folder Layout: Refined virtual sub-folder logic for folder dependency graphs
- ๐ Code Documentation: Updated internal comments for better maintainability
0.7.0 - 2026-01-30 #
Breaking change #
- Unified Ignore Directive System: Replaced inconsistent ignore patterns with a standardized
// ignore: fcheck_<domain>format across all analysis domains
Added #
- ๐ฏ Generic Ignore Pattern: New standardized format
// ignore: fcheck_<domain>for all ignore directives - ๐ง One Class Per File Ignore: Support for
// ignore: fcheck_one_class_per_fileto skip one-class-per-file rule for individual files - ๐งฎ Magic Number Ignore: Enhanced support for
// ignore: fcheck_magic_numberswith consistent pattern matching - ๐ Hardcoded String Ignore: Improved `` directive handling
- ๐๏ธ Layers Ignore: Added
// ignore: fcheck_layersfor layer architecture violations - ๐ Comprehensive Documentation: Updated all ignore directive examples and documentation
0.6.2 - 2026-01-29 #
Added #
- ๐งฎ Magic Number Ignore: Support for
// fcheck - ignore magic numberscomment directive to skip magic number analysis for individual files.
0.6.1 - 2026-01-29 #
0.6.0 - 2026-01-29 #
Added #
- ๐บ Triangular Directional Badges: New BadgeModel class with triangular badges that indicate dependency direction (incoming blue pointing west, outgoing green pointing east)
- ๐ Enhanced Badge Design: Triangular badges with rounded corners, improved text positioning, and better visual alignment with dependency edges
- ๐ Comprehensive Documentation: Added detailed DartDoc comments to BadgeModel class and all its methods
- ๐ Edge Alignment Fix: Updated SVG edge rendering to properly connect to triangular badge centers instead of old circular badge positions
Changed #
- ๐ฏ Badge System Refactor: Complete refactor from circular badges to directional triangular badges with improved visual design
- โก Performance Improvements: Optimized badge rendering and edge calculations for better SVG generation
0.5.2 - 2026-01-29 #
Added #
- ๐งฎ Magic Number Detection: New feature to detect numeric literals that should be expressed as named constants to make intent clearer
Changed #
- ๐ง Replaced the build_runner-based version builder with a simple bash script that generates
lib/src/models/version.dartfrompubspec.yaml.
Added #
- you can optionally add
// fcheck: ignore-one-class-per-fileto a file to ignore the one-class-per-file rule
0.5.1 - 2026-01-28 #
0.5.0 - 2026-01-27 #
Breaking #
- ๐ฆ Library API rename:
package:fcheck/fcheck.dartnow exposesAnalyzeFolder(oldFCheckis deprecated alias). CLI flags/behavior are unchanged.
Changed #
- ๐ Docs updated to reflect the public API and current source layout.
- ๐งน Shared SVG helpers consolidated in
svg_common.dartfor both SVG generators (no CLI impact).
0.4.5 - 2026-01-27 #
Added #
- ๐ Version Display: Added
--version/-vflag to show fCheck CLI version - ๐ท๏ธ Project Metadata: Analysis reports now include the project name and version from pubspec.yaml
- ๐ฏ Enhanced CLI: Improved argument parsing with better positional vs named argument handling
0.4.4 - 2026-01-27 #
Changed #
- โ ๏ธ/โ Localization-Aware Hardcoded Strings: Hardcoded strings now surface as errors (โ with sample listings) only when a project uses localization (l10n/AppLocalizations/.arb). Non-localized projects show a caution count (โ ๏ธ) without listing individual strings.
- ๐ Docs: README documents the new localization-aware hardcoded string behavior.
0.4.3 - 2026-01-26 #
Added #
- Shared Diagram Helpers: Introduced
graph_format_utils.dartto centralize label normalization, edge counts, and empty-graph stubs used by all diagram generators.
Changed #
- Refactor: Mermaid and PlantUML generators now consume the shared helpers, reducing duplication and keeping node IDs/counters consistent.
- Docs Refresh: Update comments and README visualization options for Mermaid/PlantUML outputs.
0.4.2 - 2026-01-24 #
Fixed #
- ๐ Dependency Detection: Fixed generator import dependencies not showing in
bin/fcheck.dartby properly qualifying generator function calls with package prefixes. - ๐ SVG Visualization: Ensured all dependencies from
fcheck.dartto graph exporters (export_mermaid.dart,export_plantuml.dart,export_svg.dart) are properly displayed in the dependency graph.
Changed #
- ๐ฆ Import Structure: Updated generator imports in
bin/fcheck.dartto use proper package prefixes for better code organization and dependency tracking.
0.4.1 - 2026-01-23 #
Fixed #
-
๐ Subdirectory Analysis: Fixed package import resolution when running analysis on a subdirectory (e.g.,
lib/) by correctly identifying the project root. -
๐ SVG Layout: Optimized column-based layout to ensure consistent grouping and correct layer ordering (Layer 1 on the left).
-
๐จ SVG Z-Order: Refined drawing order (Layers -> Nodes -> Edges -> Badges -> Labels) so edges are drawn on top of nodes, but behind text.
-
โจ Visual Polish: Added outline dilate filter to node labels for superior readability against edges.
-
โจ Visual Polish: Added white shadow filter to nodes to improve legibility against background edges.
-
๐ Node Sorting: Updated intra-column sorting to prioritize Incident dependencies (Incoming descending, then Outgoing descending), and finally alphabetical.
Added #
- โจ JSON Output Mode: New
--jsonflag to output all analysis results in structured JSON format. - ๐๏ธ Robust Layering Analysis: Implemented Tarjan's SCC algorithm to correctly handle circular dependencies.
- ๐ Top-Down Layering Logic: Improved layering algorithm for consistent "cake" layout.
Changed #
- ๐ Documentation: Major improvements to
LAYOUT.mdandREADME.md. - โก Model Updates: Metrics and issues now support JSON serialization.
0.3.5 - 2026-01-21 #
Added #
- ๐ Comprehensive API documentation for all public constructors and methods
- ๐๏ธ Private constructor for
FileUtilsutility class to prevent instantiation - ๐ Enhanced documentation for
ClassVisitor.visitClassDeclarationmethod - ๐ง Added explicit constructor documentation for hardcoded string analysis
- ๐ Complete documentation for all
@overridemethods across the codebase
0.3.4 - 2026-01-21 #
Added #
- ๐ ๏ธ Global CLI executable support via
executablesconfiguration - ๐ฆ Users can now install fcheck globally:
dart pub global activate fcheck - ๐ฅ๏ธ Direct command execution:
fcheck ./path/(after global activation)
0.3.3 - 2026-01-20 #
Added #
- โจ Support for positional path arguments (e.g.,
dart run fcheck ./path/) - ๐
--input/-ioption replacing--path/-pfor better CLI design - ๐
--help/-hflag with comprehensive usage information - ๐ฏ 'Explicit option wins' logic when both named and positional arguments provided
Changed #
- ๐ CLI argument parsing to support both positional and named arguments
- ๐ Improved usage messages and help text
Fixed #
- ๐ Positional arguments now work correctly (original issue resolved)
0.3.2 - 2026-01-20 #
- โจ Added
--fix/-fflag for automatic sorting fixes - ๐ง Automatically fixes sorting issues by writing properly sorted code back to files
- Refactored sort_source.dart into separate files: source_sort_issue.dart, class_visitor.dart, member_sorter.dart, source_sort_analyzer.dart
- Added silent mode to ProjectMetrics.printReport() to suppress console output during testing
0.3.1 - 2026-01-20 #
- Improved pubspec.yaml description with detailed package information (168 characters)
- Added comprehensive documentation for all public APIs in sort_source.dart
0.3.0 - 2026-01-20 #
Added #
- โจ Source Code Sorting: New feature to check if Flutter class members are properly sorted
- ๐ Member Organization Validation: Ensures Flutter classes follow consistent member ordering
- ๐ง Automatic Member Sorting: Detects when class members need reordering for better code organization
Technical Details #
- Added sorting analyzer for analyzing class member ordering
- Added
MemberSorterclass for sorting class members according to Flutter best practices - Integrated sorting checks into the main analysis pipeline
- Supports proper ordering: constructors โ fields โ getters/setters โ methods โ lifecycle methods
0.2.0 - 2026-01-20 #
Changed #
- Upgraded analyzer package to ^10.0.1 for better compatibility
- Updated code to use new analyzer API methods (replaced deprecated name.lexeme with toString())
- Modified file analysis to exclude example/, test/, tool/, and build directories from production code metrics
- Migrated sort_source.dart to work with analyzer ^10.0.1 API changes
- Updated sorting analyzer to use consistent directory exclusion filtering
Fixed #
- Removed unused _classNode field from MemberSorter class
- Fixed compatibility issues with analyzer package version 10.x
- Resolved issue where example directory with intentional "bad code" was being analyzed
- Updated deprecated analyzer API usage in sort_source.dart with appropriate ignore comments
- Fixed dangling library doc comments in bin/fcheck.dart and project_metrics.dart
0.1.0 - 2026-01-20 #
Added #
- Initial release of fcheck - a Flutter/Dart code quality analysis tool
- Project structure analysis (folders, files, lines of code, comment ratios)
- One class per file rule enforcement
- Hardcoded string detection
- Command-line interface with path options
- Comprehensive test suite
- MIT license
- Repository information in pubspec.yaml
Features #
- Analyze Flutter and Dart projects for code quality metrics
- Detect violations of one class per file rule
- Identify potential hardcoded strings
- Generate detailed quality reports
- CLI support with customizable paths
Technical Details #
- Built with Dart SDK >=3.0.0 <4.0.0
- Uses analyzer package for AST parsing
- Supports both individual file and directory analysis
- Cross-platform command-line tool