anteater 0.3.1
anteater: ^0.3.1 copied to clipboard
Anteater is a static analyzer for Dart that provides SSA-based data flow analysis, Datalog-based reasoning, code metrics, and configurable lint rules.
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.3.1 - 2025-12-29 #
Changed #
- Halstead Metrics: Renamed
N1/N2fields tooperatorTotal/operandTotalfor Dart naming convention compliance - SDK Version: Updated minimum SDK constraint from
^3.5.0to^3.10.0fordart_bert_tokenizercompatibility - Async I/O: Converted async file existence checks to sync versions for better performance
Fixed #
- Library Documentation: Added
library;directive to fix dangling doc comment warning - Doc Comments: Escaped angle brackets in documentation to prevent unintended HTML interpretation
- String Interpolation: Fixed string concatenation to use interpolation
- Const Usage: Applied
constconstructors and declarations throughout test files - Dynamic Calls: Fixed avoid_dynamic_calls warnings in server tests
- Unnecessary Import: Removed redundant import in metrics_test.dart
- Constructor Ordering: Moved constructors before field declarations per
sort_constructors_firstlint rule
0.3.0 - 2025-12-29 #
Added #
- Neural Analysis Setup: Semantic clone detection using ONNX Runtime
- Pre-trained nomic-embed-text model (~522MB) for 768-dimensional embeddings
- WordPiece tokenization via
dart_bert_tokenizer - Model file search order:
--modeloption →./model/→~/.anteater/ - Installation instructions for ONNX Runtime (
brew install onnxruntime)
- CLI Command:
anteater clones --path <path>for semantic clone detection- Detects semantically similar code (same functionality, different syntax)
- Configurable similarity threshold (
--threshold) - Custom model/vocab paths (
--model,--vocab) - Fallback to
~/.anteater/for global installation - Output formats: text, json
- Technical Debt Cost Model: Comprehensive debt tracking and cost estimation
DebtItemandDebtTypemodels with 10 debt types (TODO, FIXME, ignore, as dynamic, etc.)DebtSeveritywith configurable cost multipliers (critical: 4x, high: 2x, medium: 1x, low: 0.5x)DebtDetectorfor detecting debt from comments, casts, annotations, and metricsDebtCostCalculatorfor item and total cost calculationDebtReportwith Markdown, JSON, and console output formatsDebtAggregatorfor project-level aggregation and hotspot analysisDebtTrendfor tracking debt changes over time
- CLI Command:
anteater debt --path <path>for technical debt analysis- Output formats: text, json, markdown
- Threshold-based CI gate with
--fail-on-threshold - Customizable threshold with
--thresholdflag
- Debt Configuration: YAML configuration for debt costs and thresholds
- Per-type cost configuration
- Metrics-based debt thresholds (MI, complexity, LOC)
- Configurable unit of measurement (hours, story points)
0.2.0 - 2025-12-28 #
Added #
- Style Consistency Rules: 10 production-ready lint rules
- Safety rules:
avoid-dynamic,avoid-global-state,avoid-late-keyword,no-empty-block,no-equal-then-else - Quality rules:
prefer-first-last,prefer-async-await,avoid-unnecessary-cast,prefer-trailing-comma,binary-expression-order
- Safety rules:
- Rule Infrastructure
StyleRuleabstract base class for custom rulesRuleRunnerfor coordinated rule executionRuleRegistryfor rule registration and configurationRuleConfigfor YAML-based configuration parsingAnalysisResultandAnalysisResultBuilderfor multi-file results
- Rule Configuration
- Per-rule severity override
- Per-rule file exclusion patterns
- Global exclusion patterns
- CLI Command:
anteater rules --path <path>for running style rules - Performance Optimizations
- RegExp pattern caching for glob matching
- Lazy computed properties in
AnalysisResult - Unmodifiable collections in
RuleSettings - Const empty list returns
Changed #
- Improved error handling: rule execution failures reported as warnings instead of silent failures
0.1.1 - 2025-12-28 #
Added #
- High-level API:
Anteaterfacade class with one-liner static methodsAnteater.analyzeMetrics()for metrics analysis with automatic cleanupAnteater.analyze()for project diagnostics with automatic cleanupAnteater.analyzeFile()for single file analysis
- Documentation: Comprehensive dartdoc for
Anteater,SourceLoader,MetricsThresholds - Exit Codes: Documented in CLI help message
- Library Usage: Added usage examples to README.md
- Quiet Mode:
--quiet/-qflag to suppress progress output for CI pipelines - Version Constant: Centralized version string in
lib/version.dart - Single File Support:
SourceLoadernow accepts single file paths
Changed #
- Exit code for command line usage errors changed from 1 to 64 (EX_USAGE)
- Improved barrel export with explicit show clauses for key types
0.1.0 - 2025-12-28 #
Added #
-
Core Analysis Pipeline
- SSA-based data flow analysis using Braun et al. algorithm
- Control Flow Graph (CFG) construction from Dart AST
- Datalog-based relational reasoning engine
-
Metrics Calculation
- Cyclomatic complexity
- Cognitive complexity
- Halstead metrics (volume, difficulty, effort)
- Maintainability index
-
CLI Interface
- `anteater analyze` command with text, JSON, and HTML output
- `anteater metrics` command with threshold configuration
- `anteater server` for LSP mode
- `--watch` mode for continuous analysis
- `--no-fatal-infos` and `--no-fatal-warnings` flags
-
Configuration
- `analysis_options.yaml` support for threshold configuration
- CLI options override YAML configuration
-
Reasoner
- Points-to analysis
- Taint tracking infrastructure
- Abstract interpretation with interval domain
- Bounds checking for array access
Changed #
- Nothing yet (initial release)
Deprecated #
- Nothing yet (initial release)
Removed #
- Nothing yet (initial release)
Fixed #
- Nothing yet (initial release)
Security #
- Nothing yet (initial release)