FlowParse AI
Beta
JavaScript / TypeScript
Python
Generate Flow
Source Code
Funcs:
0
Complexity:
1
function processOrder(order) { if (!order.isValid) { throw new Error("Invalid order"); } let total = 0; for (let currentItem of order.items) { if (currentItem.price > 100) { total += currentItem.price * 0.9; // 10% discount } else { total += currentItem.price; } } if (total > 500) { order.status = "FLAGGED_FOR_REVIEW"; } else { try { chargeCustomer(total); order.status = "COMPLETED"; } catch (e) { order.status = "PAYMENT_FAILED"; } } return order; }
Control Flow
SVG
Code
Parsing Abstract Syntax Tree...
Enter code and click Generate to see the flowchart.
Failed to parse control flow.
Syntax error
Copied!