@@ -571,14 +571,14 @@ fn mi_rank(score: f64) -> char {
571571}
572572
573573/// Analyze source code and return MI metrics
574- fn analyze_source ( source : & str , multi : bool ) -> Result < ( f64 , char ) , String > {
574+ fn analyze_source ( source : & str ) -> Result < ( f64 , char ) , String > {
575575 let parsed = parse_module ( source) . map_err ( |e| e. to_string ( ) ) ?;
576576
577577 // Calculate raw metrics
578578 let raw = calculate_raw_metrics ( source) ;
579579
580580 // Calculate comment percentage
581- let comment_lines = raw. comments + if multi { raw. multi } else { 0 } ;
581+ let comment_lines = raw. comments + raw. multi ;
582582 let comments_percent = if raw. sloc > 0 {
583583 ( comment_lines as f64 / raw. sloc as f64 ) * 100.0
584584 } else {
@@ -608,26 +608,25 @@ fn analyze_source(source: &str, multi: bool) -> Result<(f64, char), String> {
608608}
609609
610610/// Public API for parallel module - returns (MI value, rank string).
611- pub fn analyze_source_mi ( source : & str , multi : bool ) -> ( f64 , String ) {
612- match analyze_source ( source, multi ) {
611+ pub fn analyze_source_mi ( source : & str ) -> ( f64 , String ) {
612+ match analyze_source ( source) {
613613 Ok ( ( mi, rank) ) => ( mi, rank. to_string ( ) ) ,
614614 Err ( _) => ( 0.0 , "C" . to_string ( ) ) ,
615615 }
616616}
617617
618618#[ pyfunction]
619- #[ pyo3( signature = ( entries, multi= true ) ) ]
619+ #[ pyo3( signature = ( entries) ) ]
620620pub fn harvest_maintainability_metrics (
621621 py : Python < ' _ > ,
622622 entries : Vec < ( String , String ) > ,
623- multi : bool ,
624623) -> PyResult < Vec < ( String , Py < PyDict > ) > > {
625624 let mut results = Vec :: with_capacity ( entries. len ( ) ) ;
626625
627626 for ( name, source) in entries {
628627 let dict = PyDict :: new ( py) ;
629628
630- match analyze_source ( & source, multi ) {
629+ match analyze_source ( & source) {
631630 Ok ( ( mi, rank) ) => {
632631 dict. set_item ( "mi" , mi) ?;
633632 dict. set_item ( "rank" , rank. to_string ( ) ) ?;
0 commit comments