Your comments
Yes, you are right: The parameter numbers start with 0.
Could you please also add an exception for
PathDelim + PathDelim ?
(Or am I the only one who works with UNC paths?)
Still not fixed:
constructor Tdm_DbasePrivateSession.Create(_Owner: TComponent; const _DatabaseDir: string);
begin
inherited Create(_Owner);
FDatabaseDir := _DatabaseDir;
TFileSystem.ForceDir(FDatabaseDir);
end;
constructor Tdm_DbasePrivateSession.Create(const _DatabaseDir: string);
begin
Create(nil, _DatabaseDir);
end;
constructor Tdm_DbasePrivateSession.CreateForTable(_Owner: TComponent; const _Tablename: string);
begin
Create(_Owner, ExtractFilePath(_Tablename));
end;
constructor Tdm_DbasePrivateSession.CreateForTable(const _Tablename: string); // <--- false positive W525 here
begin
CreateForTable(nil, _Tablename);
end;
Not fixed:
constructor TLutHandlerArgus2Single.Create(_SensorInfo: TSensorInfo;
_DoConvert: TLutHandlerArgus2SingleDoConvert;
_DoConvertInv: TLutHandlerArgus2SingleDoConvertInv;
_GetMinDigits: TLutHandlerArgus2SingleGetMinDigits;
_GetMaxDigits: TLutHandlerArgus2SingleGetMinDigits);
begin
inherited Create('', 0); // << call to inherited Create
FDoConvert := _DoConvert;
FDoConvertInv := _DoConvertInv;
FGetMinDigits := _GetMinDigits;
FGetMaxDigits := _GetMaxDigits;
FSensorInfo := _SensorInfo;
end;
constructor TLutHandlerArgus2Single.Create(_Filename: string; _DoConvert: TLutHandlerArgus2SingleDoConvert;
_DoConvertInv: TLutHandlerArgus2SingleDoConvertInv;
_GetMinDigits: TLutHandlerArgus2SingleGetMinDigits;
_GetMaxDigits: TLutHandlerArgus2SingleGetMinDigits);
var
fm: TdzFile;
SensorInfo: TSensorInfo;
begin
fm := TdzFile.Create(_Filename);
try
fm.OpenReadonly;
if fm.Read(SensorInfo, SizeOf(SensorInfo)) <> SizeOf(SensorInfo) then
raise Exception.CreateFmt(_('Error while reading SensorInfo from file "%s"'), [_Filename]);
Create(SensorInfo, _DoConvert, _DoConvertInv, _GetMinDigits, _GetMaxDigits); // << call to overloaded create
finally
FreeAndNil(fm);
end;
end;
if StartsStr(PathDelim + PathDelim, Full) then
gives the same warning and is definitely no error.
Just in case the wrapping above wasn't clear: The comment is to the right of the line containing the procedure declaration, not in the line below that.
No, no general exceptions. This is such a rare case that I think the programmers should take care of marking the exception. Also, it forces them to kind of document it.
The same applies to W519. Please allow us to put that comment into the method body:
procedure TGpsEaDataAccess.UpdateData;
procedure TGpsEaDataAccess.UpdateData;
begin
// FI:W519 do nothing
end;
Just to make it clear: The example above actually was a bug, but W506 masked W521: Return value of function might be undefined.
Customer support service by UserEcho
in FixInsight 2016.03 I still get a similar warning:
function TGrepHistoryList.GetItems(AIndex: Integer): TGrepHistoryListItem;
That's a false positive FHistoryList[].Items is not the property to which GetItems is the getter.