pub struct CodeFeatures {
pub ast_depth: usize,
pub node_count: usize,
pub cyclomatic_complexity: usize,
pub identifier_count: usize,
pub call_count: usize,
pub has_loops: bool,
pub has_conditionals: bool,
pub has_exceptions: bool,
}Expand description
Features extracted from source code for ML prediction
Fields§
§ast_depth: usizeAST depth
node_count: usizeNumber of AST nodes
cyclomatic_complexity: usizeCyclomatic complexity estimate
identifier_count: usizeNumber of unique identifiers
call_count: usizeNumber of function calls
has_loops: boolHas loops
has_conditionals: boolHas conditionals
has_exceptions: boolHas exception handling
Implementations§
Source§impl CodeFeatures
impl CodeFeatures
Sourcepub fn from_program(program: &GeneratedCode) -> Self
pub fn from_program(program: &GeneratedCode) -> Self
Extract features from a generated program
Trait Implementations§
Source§impl Clone for CodeFeatures
impl Clone for CodeFeatures
Source§fn clone(&self) -> CodeFeatures
fn clone(&self) -> CodeFeatures
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodeFeatures
impl Debug for CodeFeatures
Source§impl Default for CodeFeatures
impl Default for CodeFeatures
Source§fn default() -> CodeFeatures
fn default() -> CodeFeatures
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodeFeatures
impl RefUnwindSafe for CodeFeatures
impl Send for CodeFeatures
impl Sync for CodeFeatures
impl Unpin for CodeFeatures
impl UnsafeUnpin for CodeFeatures
impl UnwindSafe for CodeFeatures
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more