onClick function ! 18.8%
Last updated: 2026-03-05T11:49:57.418Z
Metrics
LOC: 29
Complexity: 11
Params: 1
Coverage: 18.8% (3/16 lines, 0x executed)
Signature
onClick(e: Event): : void
Architecture violations
- [warning] max-cyclomatic-complexity: 'onClick' has cyclomatic complexity 11 (max 10)
Source Code
function onClick(e: Event): void {
const el = e.target as Element;
if (!session || session.status !== "recording") return;
// Ignore clicks on Fill All extension UI
if (isExtensionUI(el)) return;
// Form fields are handled by onInput/onChange
if (isFormField(el)) return;
// Detect submit buttons
const isSubmit =
(el instanceof HTMLButtonElement && (el.type === "submit" || !el.type)) ||
(el instanceof HTMLInputElement && el.type === "submit");
if (isSubmit) {
addStep(
buildStep("submit", el, {
label:
el instanceof HTMLInputElement ? el.value : el.textContent?.trim(),
}),
);
return;
}
// Links and buttons
const label = el.textContent?.trim()?.slice(0, 80);
addStep(buildStep("click", el, { label }));
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| isExtensionUI | calls |
| isFormField | calls |
| addStep | calls |
| buildStep | calls |
No incoming dependencies.