Skip to content

refactor: extract duplicated alert command execution paths in syslog_process_alerts #278

@somethingwithproof

Description

@somethingwithproof

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions