Skip to content

Dead code: 3 unused exported functions in consensus-cli/src #23

Description

@openclaw-consensus-bot

Dead Code Candidates

Identified by automated dead-code hunter (2026-03-02). None of these symbols are imported or called anywhere in the codebase outside their own file.


1. isRedactionEnabledsrc/redact.ts:21

Exported but never imported or called. The internal REDACT_ENABLED constant is used directly elsewhere. Safe to remove the export (or remove the function entirely).


2. getClaudeCpuThresholdsrc/claudeCli.ts:182

Zero call sites in src/ or tests/. Likely a CPU-scaling helper extracted but never wired in. Candidate for removal — or wire into scan.ts where CPU thresholds are applied.


3. onOpenCodeRawEventsrc/opencodeEvents.ts:58

The rawListeners Set is populated but never subscribed to from outside. notifyRawListeners fires internally, but no external consumer ever registers. Either wire up a consumer or remove this pub/sub hook entirely.


Suggested Action

  • Remove or internalize isRedactionEnabled (trivial)
  • Remove getClaudeCpuThreshold or wire into scan CPU threshold logic
  • Remove onOpenCodeRawEvent + rawListeners Set + notifyRawListeners (if no consumer planned)

Directory scanned: consensus-cli/src/ (~9k LOC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions