Skip to content

Decompose check_if_block in unreachable-branch rule #174

Description

@dean0x

Location: crates/mds-core/src/lint/rules/unreachable_branch.rs:95

110-line, ~6-level-deep function repeating if !builder.push(){return} 5×. Need to split Pattern 1/2 into helpers; hoist elseif classification.

Deferred From: PR #171 (Closes #61) — mds lint release gate
Review: .devflow/docs/reviews/feat-mds-lint-61/2026-07-11_1046/resolution-summary.md

Reason for Deferral:
Structural rewrite of shipped Error-severity detection logic; behavior-preservation verification is non-trivial pre-release. Safest to tackle after stabilization.

Acceptance Criteria:

  • Extract helper functions for Patterns 1 and 2
  • Hoist elseif classification to reduce nesting
  • Maintain all error/warn/info categorization
  • All unreachable_branch tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions