Skip to content

fix: remove dead code and fix misleading debug log#57

Merged
toddr merged 1 commit intocpan-authors:mainfrom
toddr-bot:koan.toddr.bot/cleanup-dead-code
Mar 22, 2026
Merged

fix: remove dead code and fix misleading debug log#57
toddr merged 1 commit intocpan-authors:mainfrom
toddr-bot:koan.toddr.bot/cleanup-dead-code

Conversation

@toddr-bot
Copy link
Collaborator

@toddr-bot toddr-bot commented Mar 21, 2026

What

Remove three instances of dead/misleading code from Bot.pm.

Why

Dead code obscures intent and makes the module harder to maintain. The misleading DEBUG log actively confuses anyone reading debug output.

How

  • _jabber_in_iq_message: removed $iqReply (declared line 791, never assigned) and its unreachable if ($iqReply) block — leftover from when more IQ types were planned
  • Start(): removed $reconnect_timeout (set to 1, never read) — the actual sleep is hardcoded to 5
  • _process_jabber_message: moved DEBUG("Message not relevant to bot") inside the !defined $request guard so it only fires when the message is genuinely irrelevant

Testing

Full test suite passes (327 tests, 14 files).

🤖 Generated with Claude Code


Quality Report

Changes: 1 file changed, 4 insertions(+), 14 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

- Remove unused $iqReply variable and unreachable if-block in
  _jabber_in_iq_message (declared but never assigned)
- Remove unused $reconnect_timeout variable in Start()
- Move DEBUG("Message not relevant to bot") inside the return-early
  branch so it only logs when the message is actually irrelevant

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@toddr toddr marked this pull request as ready for review March 22, 2026 01:39
@toddr toddr merged commit 8511f1f into cpan-authors:main Mar 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants