Helper: create a sample node with reasonable defaults.
(id: &str, name: &str, file_path: &str)
| 36 | |
| 37 | /// Helper: create a sample node with reasonable defaults. |
| 38 | fn sample_node(id: &str, name: &str, file_path: &str) -> Node { |
| 39 | Node { |
| 40 | id: id.to_string(), |
| 41 | kind: NodeKind::Function, |
| 42 | name: name.to_string(), |
| 43 | qualified_name: format!("crate::{name}"), |
| 44 | file_path: file_path.to_string(), |
| 45 | start_line: 1, |
| 46 | attrs_start_line: 1, |
| 47 | end_line: 10, |
| 48 | start_column: 0, |
| 49 | end_column: 1, |
| 50 | signature: Some(format!("fn {name}()")), |
| 51 | docstring: Some(format!("Documentation for {name}")), |
| 52 | visibility: Visibility::Pub, |
| 53 | is_async: false, |
| 54 | branches: 0, |
| 55 | loops: 0, |
| 56 | returns: 0, |
| 57 | max_nesting: 0, |
| 58 | unsafe_blocks: 0, |
| 59 | unchecked_calls: 0, |
| 60 | assertions: 0, |
| 61 | updated_at: 1000, |
| 62 | parent_id: None, |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | fn sample_edge(source: &str, target: &str, kind: EdgeKind) -> Edge { |
| 67 | Edge { |
no outgoing calls
no test coverage detected