#![allow(unused)]
#![cfg_attr(coverage_nightly, coverage(off))]
use super::types::QueryResult;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
const IO_PATTERNS: &[(&str, &[&str])] = &[
("PRINT", &["println!", "print!"]),
("EPRINT", &["eprintln!", "eprint!"]),
("WRITE", &["write!", "writeln!"]),
(
"FS",
&["std::fs::", "File::open", "File::create", "OpenOptions"],
),
("PROCESS", &["std::process::Command", "Command::new"]),
("STDIN", &["std::io::stdin"]),
("STDOUT", &["stdout()"]),
("STDERR", &["stderr()"]),
("HTTP", &["reqwest::", "hyper::"]),
("NET", &["tokio::net::", "TcpStream", "UdpSocket"]),
("DB", &["sqlx::", "rusqlite::", "Connection::open"]),
];
#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct ExtractionCandidate {
pub function_name: String,
pub file_path: String,
pub start_line: usize,
pub loc: u32,
pub io_classification: String,
pub io_patterns: Vec<String>,
pub complexity: u32,
pub tdg_grade: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct ExtractionGroup {
pub module_name: String,
pub source_file: String,
pub functions: Vec<ExtractionCandidate>,
pub total_loc: u32,
pub pure_count: usize,
pub io_count: usize,
pub grouping_signal: String,
}
include!("extract_candidates_classification.rs");
include!("extract_candidates_grouping.rs");
include!("extract_candidates_builder.rs");
include!("extract_candidates_tests.rs");