pub mod node;
pub mod edge;
pub mod document;
pub use node::*;
pub use edge::*;
pub use document::*;
use petgraph::stable_graph::StableDiGraph;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct KnowledgeGraph {
pub graph: StableDiGraph<CodeNode, CodeEdge>,
pub modules: Vec<ModuleCluster>,
#[serde(default)]
pub features: Vec<Feature>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ModuleCluster {
pub name: String,
pub node_ids: Vec<NodeId>,
pub cohesion: f64,
pub coupling: f64,
pub description: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Feature {
pub name: String,
pub node_ids: Vec<NodeId>,
pub description: Option<String>,
}
impl Default for KnowledgeGraph {
fn default() -> Self {
Self {
graph: StableDiGraph::new(),
modules: Vec::new(),
features: Vec::new(),
}
}
}