use crate::domain::metrics::SmellDetection;
use std::fs;
use std::path::Path;
pub trait CodeParser: Send + Sync {
fn parse_code(&self, code: &str, file_name: &str) -> Vec<SmellDetection>;
fn parse_file(&self, path: &Path) -> Result<Vec<SmellDetection>, std::io::Error> {
let code = fs::read_to_string(path)?;
let file_name = path.to_string_lossy().to_string();
Ok(self.parse_code(&code, &file_name))
}
fn supported_extensions(&self) -> &[&str];
}