You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dart: cyclomatic complexity skips 'on T' handlers without a catch clause #24
Found while pinning the cognitive complexity rules for #7.
dart_decision counts only catch_clause. In tree-sitter-dart 0.2.0 an on T { ... } handler with no catch (e) has no catch_clause node: the try_statement holds a type and a block directly. Those handlers add nothing today.
With limits.complexity: 1 pickcheck 0.3.0 reports complexity 2 > 1; the spec's rule (every catch clause adds 1) gives 3.
Fix: count each handler block child of try_statement other than its body field, which is the rule the cognitive spec in #7 uses. Needs a Dart golden fixture with an on T {} handler.
Activity
feat: add cognitive complexity as the default complexity gate