What's new in Pascal Analyzer 2?

General

The limit for number of lines (65520) in a single source file has been removed. Source files can now be of virtually any size and PAL will still be able to parse them. For instance, when creating a Delphi unit wrapper for Microsoft's HTML Object Library, almost 350.000 (!) lines of code are created, which shows that this capacity is sometimes essential.
Memory management in PAL has been improved, and PAL now needs less memory to parse code and generate reports.

View source files in Delphi or a source code window
When double-clicking on a line in a report, control can now be transferred to the Delphi IDE. The relevant source file is opened in Delphi's editor window and the cursor positioned on the relevant code line. Alternatively a source code window is opened inside PAL, but then just for viewing. This feature will help you better understand the reports, because you can instantly visually inspect the code and make modifications. An invisible Delphi wizard (PalWiz.dll) is installed by the installation program to provide this feature, which is available for Delphi 5, 6 and 7.

Charts
We now introduce charts to further enhance the reports. In this version, the Complexity Report shows charts (JPEG files) for the sections describing ratings. This feature is available for reports created as HTML files.

XFM form files
It is now possible to let PAL look for XFM form files instead of DFM form files. This is needed when using the new CLX framework instead of VCL, for instance when developing for Kylix and the Linux operating system.

XML support
Reports can now also be output as XML. This format is suitable if you want to transfer the output data from PAL to a database. View XML files just like HTML files, in the built-in browser. The drawback with this format is that XML files can become very large and need a long time to load.

Wizard
The wizard assists you in selecting source code to analyze, and helps you choose other settings for the analysis. Optionally show the wizard every time you start PAL. You can also run the wizard from the File menu. The wizard lets you set a subset of all available options. If you want to fully customize your analysis, for example select output format and which reports that should be generated, use the Options dialog instead.

Exclude Folders
It is now possible to select whether an exclude folder even excludes its subfolders. In this way it is possible to select for instance "C:\Program Files\Borland\Delphi7\Source" to exclude all files in that folder and its subfolders. This is a very convenient feature.

Time for Reports
It is now possible to display the time taken to generate each report. This will be shown as the last row in each report. This information will help you determine which reports that are the most time-consuming to create.

Inconsistent Case Report
This new report lists all identifiers with inconsistent case. If for instance, the identifier "tblEmployee" is declared, and it is written as "tblemployee" in other locations, those places in the code are listed. The report is divided into two sections, the first handling inconsistent case for the same identifier, the other dealing with inconsistent case for different identifiers that share a common name.

Use this report to verify that your naming conventions are followed.

Example
..
var
  ReportHandler : TReportHandler;
begin
  Reporthandler := TReportHandler.Create; // inconsistent case
  ..
end;

Memory Report
The new Memory Report helps you find locations in your code with possible memory leaks.´There are currently two sections reporting locations where Free is called for an object in a code block that is not protected by a try-finally structure. The report does not report locations in FormDestroy and FormClose events (because these events should always occur).

Example
procedure ListHeader;
var
  SL : TStringList;
begin
  SL := TStringList.Create;
..
  SL.Free; // missing try-finally block!
end;

Conditional Symbols Report
The new Conditional Symbols Report lists locations where a $DEFINE/$UNDEF or $IFDEF/$IFNDEF directive is unnecessarily repeated. Removing these superfluous directives will make the code smaller and easier to follow.

Example
..
(*$DEFINE Final*)
var
  X : integer;
  Y : integer;

(*$DEFINE Final*) //-- unnecessary, Final is already defined
const
  sAppName = 'AppName';
(*$ENDIF*)
..
(*$ENDIF*)

New section in the Warnings Report
The new section "Ambiguous references in with-blocks" reports locations where a reference to a record field or class member exists, and where this identifier could be mixed up with another identifier in the same scope.


Example
..
var
  Title : string;

type
  TMyRec = record
    Title : string;
  end;

var
  Rec : TMyRec;
begin
  ..
  with Rec do
  begin
    ..
    Title := ´Hello';
  end;
end;

The record field referenced in the with-block could be mixed up with the global Title.
Maybe the programmer instead intended to set the global Title identifier.

New section in the Optimization Report
This new section shows nestled local procedures, with references to outer local variables. Those local variables require some special stack manipulation so that the variables of the outer routine can be seen by the inner routine. This results in decreased performance.

Example
procedure Outer;
var
  I : integer;

  procedure Inner;
  begin
    I := 555; // I is an outer variable
    ..
  end;

begin
..
end;

New features in the Complexity Report
The Complexity Report now takes considerably less time to generate. The report now also shows the ratio of comment characters to total characters. This metrics shows the comment density similar to the metrics which shows the number of comment lines divided with lines of code. A total of 21 sections have been added to the Complexity Report. These sections show different lists with ratings of modules, subprograms and classes by varying criteria, like most lines of code (LOC).

New features in the Brief Cross-reference and the Cross-reference reports
These reports now also explicitly point out the locations where objects are created and freed (destroyed).

New features in the Call Tree Report
The Call Tree Report now also displays the location ´ for the implementation of each subprogram. There is also a new option to create a complete tree, even including repeating branches if possible.

New features in the Uses Report
In the Uses Report, there is an option to display just warnings. Those warnings either tell that the unit is unnecessary or that it could be moved to the implementation uses list. This feature will make the report more comprehensive.

New features in the Control Alignment Report
There is a new option to select whether left- or right alignment should be examined.

Miscellaneous
There is a visual cue to the far right of the toolbar indicating whether reports need to be updated. It is a red square if changes in settings could produce different reports than the current, or if the reports have not been created. It shows as a green square if reports are updated.

© Copyright 2001-2015 Peganza
All product names are trademarks or registered trademarks of their respective owners.