Skip to content

False negatives for redundant jump rule #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
zaneduffield opened this issue Mar 7, 2025 · 0 comments
Open
2 tasks done

False negatives for redundant jump rule #344

zaneduffield opened this issue Mar 7, 2025 · 0 comments
Assignees
Labels
enhancement Improvements to an existing feature rule Improvements or additions to rules

Comments

@zaneduffield
Copy link
Collaborator

Prerequisites

  • This improvement has not already been suggested.
  • This improvement should not be implemented as a separate rule.

Rule to improve

RedundantJump

Improvement description

In the following example there are 2 redundant jumps that are not flagged by the current implementation of the rule

function Condition: Boolean;
begin
  Result := True;
end;

procedure Con;
begin
  for var I := 0 to 1 do begin
    if Condition then begin
      Continue; // not flagged
    end;
    Continue; // flagged
  end;
end;

procedure Brk;
begin
  for var I := 0 to 1 do begin
    if Condition then begin
      Break; // not flagged
    end;
    Break;
  end;
end;

Rationale

The rule should detect as many redundant jumps as possible, and this is another simple case to include.

@zaneduffield zaneduffield added enhancement Improvements to an existing feature rule Improvements or additions to rules triage This needs to be triaged by a maintainer labels Mar 7, 2025
@Cirras Cirras removed the triage This needs to be triaged by a maintainer label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to an existing feature rule Improvements or additions to rules
Projects
None yet
Development

No branches or pull requests

3 participants