trace_execution_path – Execution Flow Tracing
Trace execution paths through multiple files starting from an entry point with comprehensive flow analysis
Use houtini-lm to understand complex data flows and execution paths through your codebase, mapping function calls and dependencies.
Perfect For
Legacy System Understanding
Map complex business logic flows in inherited codebases to understand system behavior and dependencies.
Debugging Complex Workflows
Trace problematic execution paths to identify where issues occur in multi-file, multi-function workflows.
Architecture Documentation
Generate visual flow diagrams and documentation for complex system interactions and data transformations.
Performance Bottleneck Analysis
Identify inefficient execution paths and potential optimisation opportunities in critical business processes.
Refactoring Planning
Understand dependencies and impact scope before making architectural changes to complex systems.
Quick Start
houtini-lm:trace_execution_path with:
- entryPoint: "UserController::createUser"
- projectPath: "C:/my-api"
- traceDepth: 5
Detailed parameter tracing:
houtini-lm:trace_execution_path with:
- entryPoint: "processPayment"
- projectPath: "C:/ecommerce-app"
- traceDepth: 7
- showParameters: true
Analysis Output
Complete Execution Path
- Call Sequence: Step-by-step function call order with file locations and line numbers
- Cross-File Mapping: Detailed tracking of execution across multiple modules and files
- Decision Points: Conditional branches and their impact on execution flow
Data Transformation Tracking
- Parameter Flow: How data transforms through the execution chain
- Return Value Analysis: Data modifications and transformations at each step
- Side Effect Detection: Database operations, file modifications, and external API calls
Performance Insights
- Bottleneck Identification: Functions that may cause performance issues
- Complexity Assessment: Execution path complexity and optimisation opportunities
- Dependency Analysis: External service calls and database query patterns
Execution Analysis Example
User Registration Flow
houtini-lm:trace_execution_path with:
- entryPoint: "UserController::register"
- projectPath: "C:/user-management-api"
- traceDepth: 6
- showParameters: true
Traced Execution Path
- UserController::register (controllers/UserController.js:45)
→ Parameters: {email, password, profile} - ValidationService::validateRegistration (services/ValidationService.js:12)
→ Email format validation, password strength check - UserService::checkExistingUser (services/UserService.js:78)
→ Database query: SELECT * FROM users WHERE email = ? - PasswordService::hashPassword (services/PasswordService.js:23)
→ bcrypt hashing with salt rounds - UserService::createUser (services/UserService.js:105)
→ Database insert operation - EmailService::sendWelcomeEmail (services/EmailService.js:67)
→ External API call to email provider
Flow Analysis Results
- Total Steps: 6 function calls across 4 service files
- External Dependencies: Database (2 operations), Email API (1 call)
- Potential Bottlenecks: Email service call could timeout, no retry logic
- Error Handling: Validation errors handled, database errors propagated
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
entryPoint | string | Starting function (ClassName::method or functionName) | “PaymentService::processPayment” |
projectPath | string | Root directory for analysis | “C:/project” |
traceDepth | number | Maximum depth to trace (1-10) | 5 |
showParameters | boolean | Include parameter information | true |
analysisType | enum | Analysis focus | “execution-flow” | “call-graph” | “comprehensive” |
Entry Point Formats
- Class Methods: “UserController::createUser”, “PaymentService::process”
- Functions: “processData”, “calculateTotal”, “validateInput”
- API Routes: “POST /api/users”, “GET /api/orders/:id”
Advanced Configuration
Complex System Analysis: For large applications, focus tracing on specific subsystems to avoid overwhelming output.
// E-commerce checkout flow
houtini-lm:trace_execution_path with:
- entryPoint: "CheckoutController::processOrder"
- projectPath: "C:/ecommerce/api"
- traceDepth: 8
- showParameters: true
- analysisType: "comprehensive"
// Authentication system flow
houtini-lm:trace_execution_path with:
- entryPoint: "AuthService::login"
- projectPath: "C:/app/auth"
- traceDepth: 5
- analysisType: "execution-flow"
System Integration Analysis:
- Start with high-level business process entry points
- Use moderate traceDepth (5-7) for comprehensive coverage
- Enable showParameters for data transformation analysis
- Follow up with performance analysis using analyze_code_quality
Pro Tips
Optimal Trace Depth: Start with depth 5-6 for most workflows. Increase for complex business processes, decrease for simple utility functions.
Parameter Tracking: Enable showParameters when debugging data transformation issues or documenting complex business logic flows.
Performance Analysis: Use execution path analysis to identify potential async/await optimisation opportunities and database query consolidation.
Related Functions
- analyze_dependencies – Static dependency analysis to complement execution flow tracing
- analyze_project_structure – High-level architecture analysis for context
- suggest_refactoring – Optimisation recommendations based on execution complexity
- generate_documentation – Document complex workflows discovered through tracing