@@ -198,7 +198,8 @@ impl OutputFormatter {
198198 html. push_str ( & format ! ( " <h2>{}</h2>\n " , html_escape( & result. file_path. to_string_lossy( ) ) ) ) ;
199199 html. push_str ( & format ! ( " <p><strong>Language:</strong> {:?}</p>\n " , result. language) ) ;
200200 html. push_str ( & format ! ( " <p><strong>Lines:</strong> {}</p>\n " , result. line_count) ) ;
201- html. push_str ( & format ! ( " <p><strong>Functions:</strong> {}</p>\n " , 0 ) ) ; // Would need to count functions from symbol table
201+ let stats = result. symbols . get_statistics ( ) ;
202+ html. push_str ( & format ! ( " <p><strong>Functions:</strong> {}</p>\n " , stats. function_count + stats. method_count) ) ;
202203 html. push_str ( " </div>\n " ) ;
203204 }
204205
@@ -218,7 +219,8 @@ impl OutputFormatter {
218219 xml. push_str ( & format ! ( " <path>{}</path>\n " , xml_escape( & result. file_path. to_string_lossy( ) ) ) ) ;
219220 xml. push_str ( & format ! ( " <language>{:?}</language>\n " , result. language) ) ;
220221 xml. push_str ( & format ! ( " <lines>{}</lines>\n " , result. line_count) ) ;
221- xml. push_str ( & format ! ( " <functions>{}</functions>\n " , 0 ) ) ; // Would need to count functions from symbol table
222+ let stats = result. symbols . get_statistics ( ) ;
223+ xml. push_str ( & format ! ( " <functions>{}</functions>\n " , stats. function_count + stats. method_count) ) ;
222224 xml. push_str ( " </file>\n " ) ;
223225 }
224226
@@ -256,8 +258,9 @@ impl OutputFormatter {
256258 md. push_str ( & format ! ( "## File {}: {}\n \n " , index + 1 , result. file_path. display( ) ) ) ;
257259 md. push_str ( & format ! ( "- **Language**: {:?}\n " , result. language) ) ;
258260 md. push_str ( & format ! ( "- **Lines of Code**: {}\n " , result. line_count) ) ;
259- md. push_str ( & format ! ( "- **Functions**: {}\n " , 0 ) ) ; // Would need to count functions from symbol table
260- md. push_str ( & format ! ( "- **Variables**: {}\n " , 0 ) ) ; // Would need to count variables from symbol table
261+ let stats = result. symbols . get_statistics ( ) ;
262+ md. push_str ( & format ! ( "- **Functions**: {}\n " , stats. function_count + stats. method_count) ) ;
263+ md. push_str ( & format ! ( "- **Variables**: {}\n " , stats. variable_count) ) ;
261264 md. push_str ( & format ! ( "- **Processing Time**: {}\n \n " , Self :: format_duration( result. processing_time) ) ) ;
262265 }
263266
0 commit comments