NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #3130 most downloaded on pub.dev
Algorithmic Cognitive Complexity calculation and Data-Flow analysis library and CLI tools for Dart and Flutter.
Last release today
08 Oct 2026
Release timing varies
gaps range from 8 days to 6 weeks
Nearly every release is documented
notes for 15 of 15 stable releases
Nothing withdrawn
no release was ever pulled
2 months old
15 releases · first in 2026
One column per month.
Breaking : Pruned legacy backward-compatibility aliases, re-export shims, and internal helper leaks from the public library surface ( api.txt ):
api.txt):
ShallowFinding.callerScore and the 'caller_score' JSON aliascallerCumulativeBefore / 'caller_cumulative_before').GitDiffService and isExcludedPath re-exports frompackage:cognitive_complexity/cognitive_complexity.dart, and removed thegitService parameter from the public DeltaAnalyzer constructor (sopackage:analytica is no longer leaked in api.txt).GitHubReporter, SignatureSynthesizer,DataFlowAnalyzer.synthesizer, SplitCluster.writeText,VariableUsage.copyWith, VariableUsage.declarationOffset,DeltaStatus.label, FileSplitAnalyzer.analyzeResolvedUnit,compareBySignificance, and kAskUserPartsPreferenceDirective) from thedata_flow --format json (DataFlowResult.toJsonVariableUsage.toJson) keys to 1-to-1 snake_case field namesstart_line, end_line, enclosing_declaration, is_cleanly_extractable,enclosing_score, slice_score_in_place, slice_score_at_root,estimated_enclosing_score_after, extraction_warnings,suggested_signature, is_mutated, declaration_line, andfirst_mutation_line, retaining 'file') to match cognitive_complexity,file_split, and shallow.file_split: Eliminated super-linear cone-merge overhead on densepart fallback cuts that would leave less than 25%largestResultingFileLines, meetsTarget, andhasSurvivingCoupledScc (largest_resulting_file_lines, meets_target, andhas_surviving_coupled_scc in --format json) to FileSplitReport, printsshallow: Weights multi-arm switch expressions and switch statements bymax(0, armCount - 1) when computing statement_count so lookup-tableMICRO_HELPER, excludesextension on T declarations as library-private (<extension on T>), and() parameters as at least 1 effective parameter.data_flow: Preserves transitive generic type parameter bounds in synthesizedinputs entries as mutated when reassigned via Dart 3(a, b) = ...), detects collection await for elements,await / yield inside nested function closures.cognitive_complexity 0.4.0
cognitive_complexity 0.4.0
FunctionComplexity gains a required composition
(ComplexityComposition record: branches, nesting, booleanOps,
maxDepth) and an isTestEntrypoint getter.cognitive_complexity: --format json declarations now carry composition
(branches, nesting, boolean_ops, max_depth; the first three sum to
score) and is_test_entrypoint (top-level main of a _test.dart file).
New --verbose / -v flag adds a Breakdown column and a
[test entrypoint] tag to the text table so a flat score-15 function is
distinguishable from a five-deep pyramid. Scores are unchanged.ShallowFinding also gains sharedParamSignatureWith,
sharedParamCount, paramsSubsetOfExistingType, and simulationIndex.shallow: findings carry two descriptive parameter facts that point at a
remedy other than inlining: shared_param_signature_with /
shared_param_count (a same-file declaration sharing >= 4 parameter names,
suggesting a shared parameter record) and params_subset_of_existing_type (a
same-file type whose instance fields cover >= 4 of the parameters,
preferring the enclosing type, suggesting that object be passed directly).
Text output adds a Facts: line when either is present.shallow: report ordering is now classification, then caller groups ranked by
their most significant finding (HIGH_ARITY/SIG_HEAVY before helpers that
change the caller's score, before +0 micro-predicates), then the caller,
then simulation order (simulation_index). Within one caller the printed
order matches the inline simulation, so a Caller CC: N (base B) line never
precedes the sibling that produced N. Previously findings were ordered by
estimated lines saved.ShallowFinding gains five required constructor parameters:
effectiveParameterCount, statementCount, callerZone,
inlinedCallerScoreIsolated, and headroomAfterInline. Code that only reads
findings from ShallowAnalyzer is unaffected.shallow: MICRO_HELPER now also fires for helpers with <= 2 statements
spanning up to 15 body lines, so formatter-wrapped one-liners no longer evade
it. The reason text includes the statement count.shallow: HIGH_ARITY is evaluated against the effective parameter count,
where record-typed parameters expand to their field count; the reason text
reports both (HIGH_ARITY(4 params, 6 effective)). Only inline record type
annotations expand, one level deep. A record typedef is a type declaration
like a class and counts as one parameter, so a domain record passed through a
helper is not reported as packing.shallow: CROSS_FILE_SINGLE_CALLER is no longer reported for lib/
declarations whose single caller lives in bin/, tool/, example/, web/,
or benchmark/ (package layering, not shallow extraction). Other reasons
still apply to such helpers. Helpers with a test/ caller are, as before, not
single-caller candidates at all.shallow: JSON findings gain effective_parameter_count, statement_count,
caller_zone, inlined_caller_score_isolated (caller base score plus this
helper's delta, independent of sibling simulation order), and
headroom_after_inline (max_caller_cc - inlined_caller_score). Text output
appends [isolated B -> I, headroom H] when sibling absorption made the
cumulative score differ from the isolated one.file_split: the extraction planner now measures its remaining budget against
the physical file length (imports, comments, and blank lines included) instead
of the sum of declaration lines, matching the estimated_remaining_lines it
reports. Files that were previously left over --target-lines with "No clean
extraction cuts recommended" now receive cuts.file_split: suggested filenames derive from the largest public declaration
in the cut rather than the first one in source order.file_split: a dominator-cone cut whose root declaration(s) merely bridge two
or more otherwise-disconnected groups of >= --min-cluster-lines each is now
emitted as one cut per group. Each root joins the group it has the most edges
into and undersized groups follow their callers; the bundled cut is kept when
the groups would import each other cyclically or would need more @internal
widenings than the bundle. A root that bridges several groups only names its
group when it holds at least a third of the group's lines. Rationale reads
Sub-component of the <root> cone.file_split: the oversized-class note for a surviving declaration now reports
its declared supertype and override ratio, e.g.
implements StorageAdapter (32/51 members are @override), and when at least
half of the members are @override it states that the class size is bound by
the interface surface instead of advising that static methods be promoted.
extends X is reported the same way; mixins are not. DeclarationUnit gains
memberCount, overrideMemberCount, supertypeLabel, and an
isInterfaceBound getter (member_count, override_member_count,
supertype in JSON).file_split --format json always emits a JSON array with one
report per analyzed file. Previously a single matching file produced a bare
object and zero or several files produced an array.shallow classifies a helper whose inlining lands the caller
exactly on --max-caller-cc as ZERO_HEADROOM instead of SAFE_INLINE
(ShallowClassification.zeroHeadroom, ranked between SAFE_INLINE and
FLATTEN_AND_INLINE). SAFE_INLINE now requires the caller to stay strictly
below the ceiling. ZERO_HEADROOM helpers are not absorbed into the caller's
cumulative score for later siblings and do not count toward
--fail-on-safe-inline or --only-safe. Reports gain zero_headroom_count
and the text header lists the count.cognitive_complexity 0.3.0
cognitive_complexity 0.3.0
ShallowFinding gains two required constructor parameters,
callerBaseScore and callerCumulativeBefore. Code that only reads findings
from ShallowAnalyzer is unaffected; code constructing ShallowFinding
directly must pass both.shallow: when several single-caller helpers share one caller, the caller's
score was reported as a running cumulative total with no way to recover the
caller's real static score. Each finding now reports caller_base_score (the
caller's static score) alongside caller_cumulative_before (the simulated
score after earlier SAFE_INLINE siblings were absorbed). caller_score is
retained as an alias of caller_cumulative_before. Text output renders
Caller CC: 6 (base 3) -> 9 after inline (+3) whenever the two differ.cognitive_complexity: with --max-function-lines, the text table and the
--git-diff text table now include a Lines column, and every violation
marker names its trigger, e.g. [VIOLATION: score > 15],
[VIOLATION: lines > 60], [VIOLATION: score > 15, lines > 60], or
[VIOLATION: increased] under --fail-on-increase. Consumers matching the
bare [VIOLATION] token on stdout should match the [VIOLATION prefix
instead. JSON output is unchanged.Auto-discover default targets when no positional paths are given: Pub workspace members ( <member>/lib ), single-package lib/ , or packages/*/lib / pk
<member>/lib), single-package lib/, or packages/*/libpkgs/*/lib monorepo layouts. The GitHub Action targets input now--git-diff delta tables by review significance in every format (steptext, json): violations first, then new scoreDeltaAnalyzer.computeDeltas gains failThreshold, maxFunctionLines, andfailOnIncrease parameters and the comparator is exposed ascompareBySignificance (#53).Omit zero-complexity ( delta == 0 , score == 0 ) added and removed declarations from --git-diff Markdown, CLI, and JSON delta tables (unless they trig
delta == 0, score == 0) added and removed--git-diff Markdown, CLI, and JSON delta tables (unless--max-function-lines), add DeltaSummary.countRemoved (🗑️),Score cells as _new_ -> **N** andN -> _deleted_.shallow CLI (dart run cognitive_complexity:shallow) andShallowAnalyzer (ShallowReport, ShallowFinding, ShallowClassification)HIGH_ARITY, MICRO_HELPER,SIG_HEAVY, CROSS_FILE_SINGLE_CALLER) and simulate exact nesting-awareSAFE_INLINE,FLATTEN_AND_INLINE, LOAD_BEARING).DataFlowAnalyzer and DataFlowResultcognitive_complexity:data_flow) with nesting-aware complexity impactenclosingScore, sliceScoreInPlace, sliceScoreAtRoot,estimatedEnclosingScoreAfter) and extractionWarnings when a proposed slice>= 5 input parameters or provides low complexity payoff.--max-file-lines and --max-function-lines CLI flags and GitHubmax-file-lines, max-function-lines) with --git-diffFileLineMetric, FileLineDelta). Disablednull) by default to preserve full backward compatibility.// cognitive_complexity:ignore (per-declaration) and// cognitive_complexity:ignore_for_file (file-wide) suppression commentCommentDirectiveParser.file_split CLI (dart run cognitive_complexity:file_split) andFileSplitAnalyzer (analyzeFile / analyzeFiles) to compute acyclic file<= 800-line subsystems using Tarjan'sstatic method promotion and embedded>75%) detection for oversized classes, multi-file and--[no-]use-parts support, and zero-churnexport ... show barrel generation.--comment-output file entirely when a run has zero$GITHUB_STEP_SUMMARY. A diff that only improvesDeltaSummary.isClean(), the predicate behind that decision.--comment-output is only requested when the scannergithub format against a diff base.--exclude and --[no-]ignore-generated CLI options to configurePathFilter.pathFilter parameter to ComplexityAnalyzer and DeltaAnalyzer.::warning annotations on non-violating::error) while full deltas remain tracked in step summaries and PR commentensure_cli_readme_test.dart to verify CLI --help documentation inREADME.md.README.md to reference modularpackages/cognitive_complexity) and add rendered ActionFix action.yml monorepo auto-detection to evaluate default lib vs packages existence against the caller's $GITHUB_WORKSPACE instead of $ACTION_PATH (
action.yml monorepo auto-detection to evaluate default lib vspackages existence against the caller's $GITHUB_WORKSPACE instead of$ACTION_PATH (#76).action.yml to run the scanner from the caller's $GITHUB_WORKSPACE$ACTION_PATH, so relative targets and --git-diff resolve--comment-output and --max-comment-rows CLI options: with--format=github, write a second report capped to the most significant rowscommentFile and maxCommentRows parameters to GitHubReporter.max-comment-rows input to the GitHub Action (default 0 = unlimited)packages/cognitive_complexity.action.yml and skills/ structure for monorepo workspace.Fix data_flow crashing with PathNotFoundException when run as a standalone AOT executable ( dart run cognitive_complexity:data_flow@ / dart install ),
data_flow crashing with PathNotFoundException when run as adart run cognitive_complexity:data_flow@ /dart install), where SDK auto-discovery resolved to the app bundle--sdk-path, set DART_SDK,PATH) instead of handing the analyzer an unresolvedPATH-based discovery the Flutter checkout layout: aflutter/bin/dart wrapper script now resolves toflutter/bin/cache/dart-sdk.FLUTTER_ROOT discovery fallback.--sdk-path option to the data_flow CLI (plumbed to theDataFlowAnalyzer.sdkPath parameter); invalid explicit paths--fail-on-increase ignoring --fail-threshold: when both are set,--fail-threshold, the strict any-increase ratchet isdart-cognitive-complexity agent skill:
this) must bestatic methods) rather thanRemove accidental export of internal CognitiveComplexityVisitor from package:cognitive_complexity/cognitive_complexity.dart .
CognitiveComplexityVisitor frompackage:cognitive_complexity/cognitive_complexity.dart.Streamline README.md into a focused, scannable TL;DR.
README.md into a focused, scannable TL;DR.doc/:
doc/scoring.md: Scoring matrix, nesting multipliers, and Dart 3 AST rules.doc/cli.md: Command-line options, git diff delta evaluation, and CI ratcheting.doc/data_flow.md: Statement data-flow analysis, method extraction theory, and programmatic API.doc/github_actions.md: Complete GitHub Action workflow setup, parameters, and fork security permissions.Fix column wrapping and alignment formatting in markdown report tables.
Update the dart-cognitive-complexity agent skill: anti-goodhart 3-tier decomposition rubric with deterministic tier selection via the data_flow CLI, a
dart-cognitive-complexity agent skill: anti-goodhart 3-tier
decomposition rubric with deterministic tier selection via the data_flow
CLI, and a gated Tier 3 method-object reference
(references/method-object.md) absorbed from kevmoo/kevmoo_skills.Refine the skill's 3-Tier Decomposition Rubric per empirical feedback ( #19 ):
queue + visited) without weakening the Tier 3 gate (stays at >= 3Result dataclasses reserved for public API boundariesdata_flow signature synthesizer).enum/sealed) instead of boolean control-flow flags; ordered_Runner facades,Add support for GitHub Actions step summary and comment outputs.
Add Data-Flow analysis and helper extraction engine.
Initial release of reachability and dead/unused declaration analyzer.
// undead:ignore and// undead:ignore_for_file.pkg:dedupe:
--ignore-comments, --ignore-literals, --ignore-identifiers).--cache, --cache-dir, --clear-cache).--git-diff, --only-changed).CloneInstance, DuplicateCluster, DedupeReport) with full JSON serialization.bin/dedupe.dart).Your coding agent can read these notes before it upgrades. Set up the MCP server →