Summary
syslog_process_alerts() contains duplicated command execution blocks in two method branches (near lines 1504+ and 1567+ in functions.php).
Duplicated logic includes:
- ticket command argument composition and execution
- alert command execution + logging
- return code handling
Why refactor
Security and correctness changes (e.g., #257) now require touching both blocks. A single helper lowers maintenance risk and keeps behavior consistent across methods.
Proposed change
Extract command execution pieces into focused helpers (ticket command and alert command) and call them from both branches.
Scope
Behavior-preserving refactor only; no change to command feature flags or thresholds.