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
Rust: complexity and bool_ops skip && inside let chains #26
In tree-sitter-rust 0.24.2 the condition of if_expression, while_expression, and a match_pattern guard can be a let_chain node whose && tokens are anonymous children, not binary_expression nodes. rust_decision and is_boolean_operator only look at binary_expression, so those operators count for neither metric.
fnf(x:Option<u8>,y:Option<u8>,c:bool){ifletSome(a) = x && letSome(b) = y && c && a > b {}}
pickcheck 0.3.0 reports complexity 2 and bool_ops 0; the spec gives 5 and 3. The repo itself uses let chains (edition 2024), so this undercounts its own gate.
Fix: count each anonymous && child of let_chain as a decision point and as a boolean operator in the chain. Needs a Rust golden fixture with a let chain.
Activity
feat: add cognitive complexity as the default complexity gate