AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Neuer FixInsight ist da!

Ein Thema von Insider2004 · begonnen am 10. Feb 2015 · letzter Beitrag vom 24. Apr 2016
Antwort Antwort
Der schöne Günther

Registriert seit: 6. Mär 2013
6.222 Beiträge
 
Delphi 10 Seattle Enterprise
 
#1

AW: Neuer FixInsight ist da!

  Alt 26. Mär 2015, 17:51
I don't know about this DelphiAST, but what about the other way around? Just parse as you always do. We now have a list of warnings and the line number it occurred on.

So in case the code goes like this
Delphi-Quellcode:
25:   procedure TChild.someVirtualMethod();
26:   begin
27:    // No quack at all
28:   end;
, there is a W519 raised for line 25. Now before outputting our results to the IDE's listbox, let's check line 25 whether it contains a comment with an exclamation mark followed by "W519".

So if the code is like
Delphi-Quellcode:
25:   procedure TChild.someVirtualMethod(); //!W519 because FixInsight is smart
26:   begin
27:    // No quack at all
28:   end;
, there will be no "false positive".
  Mit Zitat antworten Zitat
Roman Yankovsky

Registriert seit: 18. Feb 2015
 
#2

AW: Neuer FixInsight ist da!

  Alt 26. Mär 2015, 21:29
Nice idea
  Mit Zitat antworten Zitat
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
10.119 Beiträge
 
Delphi 12 Athens
 
#3

AW: Neuer FixInsight ist da!

  Alt 27. Mär 2015, 05:20
This could even be expanded to the whole unit scope (for example for 3rd party units, where only the first line would have to be modified then):
Delphi-Quellcode:
unit Example; //!W519 (cannot be fixed because of...)
...
Sebastian Jänicke
AppCentral
  Mit Zitat antworten Zitat
Roman Yankovsky

Registriert seit: 18. Feb 2015
 
#4

AW: Neuer FixInsight ist da!

  Alt 4. Okt 2015, 18:30
Finally FixInsight 2015.10 is able to suppress a warning for a piece of code (that was discussed on a previous page). It works not for a scope, but for a particular line though.

Example:
Delphi-Quellcode:
      procedure RestartTimer;
      begin
        FTimer.Enabled := False;
        FTimer.Enabled := True; //FI:W508 - this warning will be ignored.
      end;
So it's just a "FI:<RULENUMBER>" comment.
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.222 Beiträge
 
Delphi 10 Seattle Enterprise
 
#5

AW: Neuer FixInsight ist da!

  Alt 4. Okt 2015, 20:53
Neat! That is WAY better than using IFDEF blocks
  Mit Zitat antworten Zitat
Roman Yankovsky

Registriert seit: 18. Feb 2015
 
#6

AW: Neuer FixInsight ist da!

  Alt 2. Dez 2015, 10:03
I would like to announce Christmas bundle. FixInsight and Parnassus Navigator go together.

http://sourceoddity.com/blog/2015/12...sus-navigator/
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.222 Beiträge
 
Delphi 10 Seattle Enterprise
 
#7

AW: Neuer FixInsight ist da!

  Alt 3. Mär 2016, 10:14
I have updated from 2015.10 to 2015.11 and would like to report a few things:

Fatal Parse error
caused by the following code:
Delphi-Quellcode:
function TSomeClass.calcSomething(const someCount: Integer): Integer;
begin
   Result := 'REG11111;2;33333333;44444444;55555555'.Length * someCount; // <-- This line
   [...]
end;
This did not cause a fatal error in 2015.10

C110: Getter or setter name is different from property declaration
The following code causes a C110. I guess it's because of the "&":
Delphi-Quellcode:
      public property
         &Register[index: TRegisterIndex]: TRegisterValue
            read getRegister
            write setRegister;
            default;

W521 Return value of function might be undefined
The following code did not cause this warning in 2015.10:

Delphi-Quellcode:
type TSomeEnum = (uno, dos, tres);

function TSomeClass.getSomeValue(): TSomeEnum;
begin
   if someCondition() then
      Exit(TSomeEnum.uno)
   else
      if someOtherCondition() then
         Exit(TSomeEnum.dos)
      else
         Exit(TSomeEnum.tres);
end;
O802 ResourceString is declared but never used
That's an excellent idea!

W528: Variable not used in for-loop
This is strange one. The following code produces a W528:

Delphi-Quellcode:
unit Unit1;

interface uses System.Generics.Collections, System.SysUtils;

type

   TPair = System.Generics.Collections.TPair<Single, Single>;
   TPairs = TArray<TPair>;

   TPairsExporter = class
      public class function DataAsString(const pairs: TPairs): String;
   end;

implementation uses System.Classes;

class function TPairsExporter.DataAsString(const pairs: TPairs): String;
var
   stringBuilder:   TStringBuilder;
   pair:          TPair;
begin
   stringBuilder := TStringBuilder.Create();
   try
      for pair in pairs do
         stringBuilder.Append(pair.Key).Append(sLineBreak);

      Result := stringBuilder.ToString();
   finally
      stringBuilder.Destroy();
   end;
end;

end.
.

If you remove the ".Append(sLineBreak)", the warning is gone. Oh, and please ignore the fact that using a for..in with records was not the best idea
  Mit Zitat antworten Zitat
Benutzerbild von Stevie
Stevie

Registriert seit: 12. Aug 2003
Ort: Soest
4.055 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#8

AW: Neuer FixInsight ist da!

  Alt 3. Mär 2016, 12:22
Trag die Sachen doch einfach in den offiziellen bugtracker ein.
Stefan
“Simplicity, carried to the extreme, becomes elegance.” Jon Franklin

Delphi Sorcery - DSharp - Spring4D - TestInsight
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.222 Beiträge
 
Delphi 10 Seattle Enterprise
 
#9

AW: Neuer FixInsight ist da!

  Alt 21. Apr 2016, 17:29
Consider the following:

Delphi-Quellcode:
   IFirstInterface = interface
      procedure doStuff();
   end;

   ISecondInterface = interface
      procedure doStuff();
   end;

   TImplementation = class(TInterfacedObject, IFirstInterface, ISecondInterface)
      procedure doStuff();
   end;
Compiles and works fine (unlike other languages). But probably not what you want. I know about method resolution clauses and how to get around it. But I would like to get a warning that this does not look right at all.

Opinions?
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:34 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz