Statement follows an unconditional return

ID

dart.correctness.unreachable_code

Severity

low

Remediation Complexity

trivial

Remediation Risk

low

Remediation Effort

low

Resource

Dead Code

Language

Dart

Description

This statement follows an unconditional return, so it can never execute. Remove it, or move it above the return if it was meant to run.

Rationale

This statement follows an unconditional return, so it can never execute. Remove it, or move it above the return if it was meant to run.

The following code illustrates the pattern detected by this rule:

class Unreachable {
  // FLAGGED: Statement follows an unconditional return
  void afterReturn(int x) {
    return;
    print('never runs');
  }
}

Remediation

Follow secure coding practices and review the references below for detailed remediation guidance.

Configuration

This detector does not need any configuration.

© 2026 Xygeni. All rights reserved