pub struct Function {
pub line: u32,
pub end_line: u32,
pub decision_points: u32,
pub source_lines: u32,
pub name: Option<String>,
pub cognitive_complexity: u32,
pub coverage: Option<FunctionCoverage>,
}Expand description
One function of a source file. A nested function is a function of its own and adds no decision points to the function around it.
Fields§
§line: u32The line where the function starts, counted from 1.
end_line: u32The line where the function ends, counted from 1; the same as line for a function on one line.
decision_points: u32The decision points of the function, not counting those of nested functions.
source_lines: u32The source lines of the function, not counting lines of nested functions.
name: Option<String>The optional name of the function or method; none for anonymous lambdas and closures.
cognitive_complexity: u32The nesting-weighted cognitive complexity of the function, not counting nested functions.
coverage: Option<FunctionCoverage>Coverage counts for the function from Coverage reports; none when no Coverage report covers the function.
A Language plugin always returns none; codeint fills this in before Metrics run.