mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-24 14:34:23 +00:00
902c7d832b
CFG treats diverging calls as its completely own path out of the function. While this makes sense, it should also mean that a panic should increase the cyclomatic complexity. Instead it decreases it. Minimal example: ```rust if a { b } else { panic!("cake"); } d ``` creates the following graph ```dot digraph G { "if a" -> "b" "if a" -> "panic!(\"cake\")" "b" -> c } ``` which has a CC of 1 (3 - 4 + 2). A CC of 1 means there is one path through the program. Obviously that is wrong. There are two paths. One returning normally, and one panicking. |
||
---|---|---|
.. | ||
compile-fail | ||
cc_seme.rs | ||
compile-test.rs | ||
consts.rs | ||
dogfood.rs | ||
mut_mut_macro.rs | ||
trim_multiline.rs |