Enter forum description here ...
0

[W507] Regression from 2015.11 to 2016.04: Missing semicolon suppresses warning

Uwe Schuster 9 years ago 0

FixInsight 2016.04 does not show a W507 warning, which 2015.11 did show. It seems to be related to the missing semicolon.

procedure Foo;
begin
end;
procedure Bar;
begin
if True then
Foo
else
Foo //no semicolon here suppresses W507
end;

0

W525 Missing inherited false positive when parent class is abstract

Anonymous 9 years ago updated by Sorien 9 years ago 0

and another idea there are many places where IDE generates function with inherited keyword even there is no such method in parent class

0

Variable read after for-loop

il2 9 years ago updated 9 years ago 1

This is biggest mistake to count on last value of for-loop variable after the loop:

procedure Test;
var i: Integer;
begin
for i:= 1 to 5 do
Writeln(i);
Writeln(i);
end;


It seems you can count on intermediate value on Break

for i:= 1 to 5 do
if i mod 3 = 0 then Break
else Writeln(i);
Writeln(i);

But this is undocumented, you should know if Break was executed and both cases are too danger to rely on due to optimization which can suddenly use a register for loop var.


This is inspired by Peganza Pacal Expert rules.

0

Warn about invalid //FI comments

dummzeuch 9 years ago 0

I happened to me several times: I added a //FI comment to suppress a specific warning and wondered why it didn't work. Some rather long time later I found out why: The number after the //FI: was wrong or I forgot the W or C in front of the number.

It would be nice if FixInsight could warn, if the //FI comment parameter is invalid.

0
Under review

[W513] False positives with numbered parameters

Anonymous 9 years ago updated by Lübbe Onken 9 years ago 6

Fixinsight 2015.11upd2


I didn't check all combinations, but I think that this example illustrates the problem


procedure TForm1.FormCreate(Sender: TObject);
var
  iError: integer;
  sError: string;
begin
  Format('Code %d [%s]', [iError, sError]);
  Format('Code %s [%s]', [sError, sError]);
  Format('Code %s [%d]', [sError, iError]);
  Format('Code %d [%d]', [iError, iError]);
  Format('Code %1:d [%2:s]', [iError, sError]); // <-- False positive
  Format('Code %1:s [%2:s]', [sError, sError]); // <-- False positive
  Format('Code %1:s [%2:d]', [sError, iError]); // <-- False positive
  Format('Code %1:d [%2:d]', [iError, iError]); // <-- False positive
end;
0
Completed

Global FixInsight settings in the Project menu

il2 9 years ago updated by Roman 9 years ago 2

Please add the possibility to set global FixInsight Settings for projects without .ficfg file.

Registry, %AppData% or %AppDataLocal% are good places to save global settings to.

No need to move FixInsight Settings menu item to Delphi Settings as Nicholas Ring suggested.

Leaving FixInsight Settings in the Project menu available will be enough.

Suggested behaviour is similar to Global madExcept and JCL Debug Expert settings in the Project menu.

0

FixInsight version info in Delphi, Help, About and check results

il2 9 years ago 0

Please add FixInsight version info into Delphi, Help, About dialog and FixInsight check results.

It will be easier to check FixInsight version installed and when results are copied and/or shared.

0

Boolean(Integer) cast check

il2 9 years ago 0

Please add a check for very likely erroneous Boolean(Integer) cast because except Boolean(0)=FALSE and Boolean(1)=TRUE all other Boolean(Integer) are UNDEFINED and not TRUE as one may assume. Actually, Ord(Boolean(N))=N! This is undefined behavior and very error-prone.


Consider this example:

program BooleanTest;

{$APPTYPE CONSOLE}

uses SysUtils;

begin

Writeln(Boolean(0) = TRUE); //results in FALSE - OK

Writeln(Boolean(1) = TRUE); //results in TRUE - OK

Writeln(Boolean(4) = TRUE); //results in FALSE - FAIL!

Writeln(Ord(Boolean(4))); //results in 4 - OUCH!

end.


https://quality.embarcadero.com/browse/RSP-13972

0

Detect ExecSQL/TDataSet.Open erroneus pair

il2 9 years ago updated 9 years ago 0

Would it be nice to detect these cases?


ADOQuery1.ExecSQL;
ADOQuery1.Open;

...

ADOStoredProc1.ExecProc;
ADOStoredProc1.Open;


i.e. Exec* and Open are doing the same thing and first Exec* is just unnecessary.

0

New warning "Parameter <xxx> is passed to method but never used"

Lübbe Onken 9 years ago 0

In addition to Delphis compiler warning "Parameter <xxx> is declared but never used" I'd like to have a warning that triggers on the following case:


procedure Test(AValue: string);
begin
  writeln('hallo');
end;
A warning "Parameter 'AValue' is passed into procedure 'Test' but never used", would help to detect many corpses that are carried around in some applications.