pub trait ClassNode {
Show 13 methods
// Required methods
fn id(&self) -> &str;
fn namespace(&self) -> &str;
fn line_count(&self) -> u32;
fn method_count(&self) -> u32;
// Provided methods
fn method_connectivity(&self) -> Option<&MethodConnectivity> { ... }
fn cyclomatic_complexity(&self) -> Option<&Value> { ... }
fn halstead_eta1(&self) -> u32 { ... }
fn halstead_eta2(&self) -> u32 { ... }
fn halstead_n1(&self) -> u32 { ... }
fn halstead_n2(&self) -> u32 { ... }
fn method_tokens(&self) -> Option<&Value> { ... }
fn method_fingerprints(&self) -> Option<&Value> { ... }
fn call_sequences(&self) -> Option<&Value> { ... }
}Expand description
Minimum interface the metric algorithms need from a graph node.
method_connectivity has a default impl returning None so that external
node types (e.g. kg-store) can implement this trait without providing
connectivity data until they need LCOM4.
Required Methods§
fn id(&self) -> &str
fn namespace(&self) -> &str
fn line_count(&self) -> u32
fn method_count(&self) -> u32
Provided Methods§
fn method_connectivity(&self) -> Option<&MethodConnectivity>
Sourcefn cyclomatic_complexity(&self) -> Option<&Value>
fn cyclomatic_complexity(&self) -> Option<&Value>
Raw cyclomaticComplexity JSON blob — shape
{"methods": [{"name": str, "complexity": int}, …]}.
Default None for nodes from extractors that omit it.
Sourcefn halstead_eta1(&self) -> u32
fn halstead_eta1(&self) -> u32
Halstead raw counts. Default 0 for nodes without the attribute — η = 0 short-circuits V to 0, so a missing-data class produces the same answer as a class with no operators or operands.
fn halstead_eta2(&self) -> u32
fn halstead_n1(&self) -> u32
fn halstead_n2(&self) -> u32
Sourcefn method_tokens(&self) -> Option<&Value>
fn method_tokens(&self) -> Option<&Value>
Raw methodTokens JSON blob — shape
{"methods": [{"name": str, "tokens": [str]}, …]}.
Sourcefn method_fingerprints(&self) -> Option<&Value>
fn method_fingerprints(&self) -> Option<&Value>
Raw methodFingerprints JSON blob — shape
{"methods": [{"name": str, "tokens": "TOK TOK TOK", "line": int, …}, …]}.
Distinct from methodTokens: fingerprint tokens are space-separated
normalised token-class strings used for clone detection.
Sourcefn call_sequences(&self) -> Option<&Value>
fn call_sequences(&self) -> Option<&Value>
Raw callSequences JSON blob — shape
{"sequences": [{"method": str, "calls": [str], …}, …]}. Each sequence
is the ordered list of method names a single method invokes; used as a
transaction for association-rule mining and as a trace log for process
mining.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".