Skip to content

Commit c9b1860

Browse files
committed
Check pt fixing errors
1 parent 697fa8f commit c9b1860

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

crates/web-ui/src/handlers.rs

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ async fn perform_multi_file_analysis(
469469
},
470470
functions: function_infos,
471471
complexity_distribution: calculate_complexity_distribution(&functions),
472-
dependencies: extract_dependencies(&semantic),
473-
issues: detect_issues(&semantic),
472+
dependencies: extract_dependencies(&semantic.symbol_table),
473+
issues: detect_issues(&semantic.symbol_table),
474474
};
475475

476476
file_results.push(file_result);
@@ -574,40 +574,48 @@ fn calculate_complexity_distribution(functions: &[smart_diff_semantic::Function]
574574
distribution
575575
}
576576

577-
fn extract_dependencies(semantic: &smart_diff_semantic::SemanticInfo) -> Vec<String> {
578-
// This would extract actual dependencies from semantic analysis
577+
fn extract_dependencies(symbol_table: &smart_diff_semantic::SymbolTable) -> Vec<String> {
578+
// This would extract actual dependencies from symbol table
579579
// For now, return empty vector
580+
let _ = symbol_table; // Suppress unused parameter warning
580581
vec![]
581582
}
582583

583-
fn detect_issues(semantic: &smart_diff_semantic::SemanticInfo) -> Vec<String> {
584-
// This would detect code issues from semantic analysis
584+
fn detect_issues(symbol_table: &smart_diff_semantic::SymbolTable) -> Vec<String> {
585+
// This would detect code issues from symbol table
585586
// For now, return empty vector
587+
let _ = symbol_table; // Suppress unused parameter warning
586588
vec![]
587589
}
588590

589591
fn perform_cross_file_analysis(
590-
functions: &[smart_diff_semantic::Function],
592+
functions: &[smart_diff_parser::Function],
591593
files: &[FileInfo],
592594
) -> anyhow::Result<CrossFileAnalysis> {
593595
// Detect duplicate functions
594596
let mut duplicate_functions = Vec::new();
595597
let mut seen_signatures = HashMap::new();
596598

597599
for function in functions {
598-
if let Some(existing_locations) = seen_signatures.get_mut(&function.signature) {
600+
let signature_str = format!("{}({})", function.signature.name,
601+
function.signature.parameters.iter()
602+
.map(|p| format!("{}: {}", p.name, p.param_type.to_string()))
603+
.collect::<Vec<_>>()
604+
.join(", "));
605+
606+
if let Some(existing_locations) = seen_signatures.get_mut(&signature_str) {
599607
existing_locations.push(ChangeLocation {
600608
file: "unknown".to_string(), // Would need to track file association
601-
start_line: function.start_line,
602-
end_line: function.end_line,
603-
function: Some(function.name.clone()),
609+
start_line: function.location.start_line,
610+
end_line: function.location.end_line,
611+
function: Some(function.signature.name.clone()),
604612
});
605613
} else {
606-
seen_signatures.insert(function.signature.clone(), vec![ChangeLocation {
614+
seen_signatures.insert(signature_str, vec![ChangeLocation {
607615
file: "unknown".to_string(),
608-
start_line: function.start_line,
609-
end_line: function.end_line,
610-
function: Some(function.name.clone()),
616+
start_line: function.location.start_line,
617+
end_line: function.location.end_line,
618+
function: Some(function.signature.name.clone()),
611619
}]);
612620
}
613621
}

0 commit comments

Comments
 (0)