Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Too many "Hint on useless fi:xxxx comments"

 Post Reply Post Reply
Author
Onken L. View Drop Down
Member
Member
Avatar

Joined: 16 Jun 2010
Posts: 60
Post Options Post Options   Quote Onken L. Quote  Post ReplyReply Direct Link To This Post Topic: Too many "Hint on useless fi:xxxx comments"
    Posted: 29 May 2018 at 2:13pm
Finally upgraded to FixInsight 2017.11 and ran into some issues.

It looks like there is a bug in this option and/or in the detection of empty methods

The following code passed the FixInsight 2016.09 checks, but under FixInsight 2017.11 the hint "[FixInsight Internal] Unit.pas(304): I901 Useless comment "fi:w519" detected. No warnings or hints have been found at this line" is shown.

procedure TFormBase.Translate;
begin //FI:W519 - Placeholder for derived classes
end;

When I remove the comment, the FI:W519 "Method %s is empty" isn't shown as expected. So it looks like the empty method detection was changed and/or doesn't work anymore.

We also have tons of code of the following form where FixInsight now shows a hint:
procedure TFormBase.DoSomething;
begin //FI:W519 - Code not needed for product X
{$IFNDEF PRODUCTX}
  DoSomethingMore;
{$ENDIF}
end;

Even worse, FixInsight ignores the define when checking for this hint. The hint is shown no matter whether PRODUCTX is defined or not.

procedure TFormBase.DoSomething;begin
{$IFNDEF PRODUCTX}
  //FI:W519 - Code not needed for product X
{$ELSE}
  DoSomethingMore;
{$ENDIF}
end;

The same problem seems to exist for W528. The code below also shows the "useless comment error" and the W528 isn't detected anymore.

      for I := 1 to Count div 2 do // FI:W528 ignorieren
        if UseNew then
          begin
            Send(ID2_neu);
            Send(ID3_neu);
          end
        else
          begin
            Send(ID2);
            Send(ID3);
          end;

Hopefully you can fix this soon.
Back to Top
Roman Yankovsky View Drop Down
New Member
New Member
Avatar

Joined: 21 Jun 2016
Posts: 26
Post Options Post Options   Quote Roman Yankovsky Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2018 at 3:25pm
Thanks for letting me know. I'll try to fix this asap.
Back to Top
Onken L. View Drop Down
Member
Member
Avatar

Joined: 16 Jun 2010
Posts: 60
Post Options Post Options   Quote Onken L. Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2018 at 3:38pm
It looks like FixInsight is too sensitive about whitespace. Not necessarily ignoring the {$IFDEF}, but I couldn't really narrow it down yet.

IMHO this:
procedure TFormBase.DoSomething;
begin{$IFNDEF PRODUCTX} //FI:W519 - Code not needed for product X
{$ELSE} DoSomethingMore;{$ENDIF}end;

should deliver the same result as this:
procedure TFormBase.DoSomething;
begin
{$IFNDEF PRODUCTX}
  //FI:W519 - Code not needed for product X
{$ELSE}
  DoSomethingMore;
{$ENDIF}
end;

I had the impression that by fiddling around with line breaks and whitespace, I could make the code pass the FI check.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down