MCPcopy Create free account
hub / github.com/CodeBendKit/codeseek / _create_heuristic_calls

Method _create_heuristic_calls

rust-core/src/codegraph/parser.rs:1401–1426  ·  view source on GitHub ↗

创建启发式调用关系

(
        &self,
        main_function: &FunctionInfo,
        all_functions: &[FunctionInfo],
        code_graph: &mut PetCodeGraph,
    )

Source from the content-addressed store, hash-verified

1399
1400 /// 创建启发式调用关系
1401 fn _create_heuristic_calls(
1402 &self,
1403 main_function: &FunctionInfo,
1404 all_functions: &[FunctionInfo],
1405 code_graph: &mut PetCodeGraph,
1406 ) {
1407 // 为main函数创建到其他函数的调用关系
1408 for other_func in all_functions {
1409 if other_func.id != main_function.id {
1410 let relation = CallRelation {
1411 caller_id: main_function.id,
1412 callee_id: other_func.id,
1413 caller_name: main_function.name.clone(),
1414 callee_name: other_func.name.clone(),
1415 caller_file: main_function.file_path.clone(),
1416 callee_file: other_func.file_path.clone(),
1417 line_number: main_function.line_start,
1418 is_resolved: false, // 启发式调用标记为未解析
1419 };
1420
1421 if let Err(e) = code_graph.add_call_relation(relation) {
1422 warn!("Failed to add heuristic call relation: {}", e);
1423 }
1424 }
1425 }
1426 }
1427
1428 /// 创建测试调用关系
1429 fn _create_test_calls(

Callers 1

Calls 1

add_call_relationMethod · 0.45

Tested by

no test coverage detected