pub struct TreeMetrics {
pub nodes: u64,
pub decisions: u64,
pub max_depth: u32,
}Expand description
一个根(通常是方法体)的结构指标。
Fields§
§nodes: u64子树节点总数(从根可达的 arena 节点;不含编辑残留的游离节点)。
decisions: u64判定点数:if / while / do / for / foreach / case / catch / 三元 /
&& / ||(McCabe 复杂度的决策点部分)。
max_depth: u32最大嵌套深度(语句容器嵌套层数;反编译嵌套块与扁平化状态机 的直接体现)。
Implementations§
Source§impl TreeMetrics
impl TreeMetrics
pub fn add(&mut self, other: TreeMetrics)
Trait Implementations§
Source§impl Clone for TreeMetrics
impl Clone for TreeMetrics
impl Copy for TreeMetrics
Source§impl Debug for TreeMetrics
impl Debug for TreeMetrics
Source§impl Default for TreeMetrics
impl Default for TreeMetrics
impl Eq for TreeMetrics
Source§impl PartialEq for TreeMetrics
impl PartialEq for TreeMetrics
impl StructuralPartialEq for TreeMetrics
Auto Trait Implementations§
impl Freeze for TreeMetrics
impl RefUnwindSafe for TreeMetrics
impl Send for TreeMetrics
impl Sync for TreeMetrics
impl Unpin for TreeMetrics
impl UnsafeUnpin for TreeMetrics
impl UnwindSafe for TreeMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more