logo
  • Buy
  • Download
  • Documentation
  • Blog
  • Contact

25 Apr 2016

FixInsight 2016.04 support Delphi 10.1 Berlin

by Roman Yankovsky 1 Comment

Have you already upgraded to Delphi 10.1 Berlin? I’m happy to announce FixInsight 2016.04 release with full Delphi 10.1 support.

What’s New

  • Delphi 10.1 Berlin support
  • Improved parser
  • Some false positives fixed

http://sourceoddity.com/fixinsight/download.html

23 Apr 2016

FixInsight vs FMX in Delphi 10.1 Berlin

by Roman Yankovsky Leave a comment

It becomes a good tradition to do a static analysis of FMX after each new Delphi release. I have already done this for Delphi XE8 and Delphi 10 Seattle. Now it’s a time to take a look at FMX in Delphi 10.1 Berlin (24.0.22858.6822).

As usual I will try to skip minor issues and mention only the most interesting parts of code (have you ever thought how many empty “except” blocks in FMX?).

There are a no new issues found by FixInsight! Very good! But let’s talk about strange code, that hasn’t been changed since previous releases.

W511 Object ‘LinePath’ created in TRY block

  for I := 0 to FFrame3D.Count - 1 do
  try
    LinePath := TPathData.Create;
    LLine := FFrame3D[I];
    LineAdvance := 0;

No, it’s not that case when you set a variable to nil before a try block :)

W528 Variable ‘J’ not used in FOR-loop

    // Iterate through each control's list and remove gesture ID's
    // that don't exist in the updated FCustomGestures list
    for P in FControls do
      for I := P.Value.Count - 1 downto 0 do
        for J := 0 to FRecordedGestures.Count - 1 do
        begin
          if (P.Value[I].GestureType = TGestureType.Recorded) and
            (FRecordedGestures.FindGesture(P.Value[I].GestureID) = nil)
          then
            P.Value.Delete(I);
        end;

But why the inner J-loop is needed? Why is it there?

W505 Empty THEN block

      if FoundValue.Count > 1 then
      else if FoundValue.Count > 0 then
        PropValues[Name] := FoundValue[0];

I still wonder why it’s not replaced with “If FoundValue.Count = 1 then PropValues[Name] := FoundValue[0]” since Delphi XE8 (or maybe even earlier).

W508 Variable is assigned twice successively

    Difference := [];
    Difference := Value - FInteractiveGestures;
      P := Content.LocalToAbsolute(BottomRight);
      P := AItem.ParentControl.AbsoluteToLocal(Content.LocalToAbsolute(BottomRight));
  ISFNkey := False;
  ISFNkey := Kind = TKeyKind.Functional;
      RootViewRect := SharedApplication.keyWindow.rootViewController.view.frame;
      RootViewRect := SharedApplication.keyWindow.rootViewController.view.bounds;

Not a major issue, but FMX code could be a bit cleaner without this.


The good news is that most bugs reported in my previous posts seem to be fixed. General impression is much better.

But the developers of FMX shouldn’t relax, next time I’ll come up with even more comprehensive checks and rules :)

  • Announcements
  • DelphiAST
  • DelphiSpec
  • FixInsight
  • FMX
  • Other
  • VCL

Recent Posts

  • Find leaks in Delphi with Deleaker
  • FixInsight and the inline directive
  • FixInsight 2017.04 support Delphi 10.2 Tokyo
  • FixInsight 2016.04 support Delphi 10.1 Berlin
  • FixInsight vs FMX in Delphi 10.1 Berlin

Archives

  • January 2020
  • April 2017
  • April 2016
  • March 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • April 2015
  • March 2015
  • February 2015
  • September 2014
  • August 2014
  • January 2014
  • December 2013
  • October 2013

Recent Comments

  • anapa-poseidon3.ru on FixInsight vs RTL
  • Heat pump on FixInsight vs RTL
  • Suing on FixInsight vs RTL
  • JorgeJag on Find leaks in Delphi with Deleaker
  • Prorabdom on FixInsight vs RTL
  • Home
  • Buy
  • Download
  • Documentation
  • Blog
  • Contact
  • © 2014-2015 SourceOddity|
  • Terms and Conditions|
  • Privacy Policy