What's new in Pascal Analyzer 5?

This is a description of the changes and new features in Pascal Analyzer version 5.

Supports Delphi XE
All Delphi versions including the new Delphi XE are supported.

Build reports in multiple threads
Take advantage of the new generations of multi-core processors, and generate reports quicker by using multiple threads. Of course your result will depend on your particular hardware. Greater number of processors and cores normally means faster reports.

There is a new option to set the number of threads that should be used when creating reports. For a dual-core processor, this means that two threads is probably a suitable choice. This is also the default value.

Because your mileage may vary, you should probably experiment with this setting to find optimal number of threads for a particular project and hardware.

Suppress reporting by source line
It is now possible to let PAL skip reporting, for selected source code lines. This is convenient, to avoid the false positives that PAL sometimes outputs. Remember, that unlike the compiler, PAL does not always have access to the complete source code, making it hard to resolve all references correctly.

By adding a special comment, like for example:

//PALOFF

.. at the end of a source code line, means that PAL will not report any issues found on that particular line. Also, if you put the comment on a line where an identifier is declared, that identifier will not be reported. This is the most effective way to get rid of all issues for a particular identifier.

Like

..
var
  I : integer; // PALOFF
..

ResetItem(I); // gives false report by PAL
..


It is possible to select what string should be used as the marker. Default value for the suppression marker is "PALOFF", but you can change this to something else. Blank spaces between "//" and the suppression marker are allowed. You can also have more comment text to the right of the marker, like:

//PALOFF because false warning otherwise

New Exception Report
You could think that the over 40 reports already available cover most demands. But one area that has not been touched in previous versions of PAL is exceptions. This new report produces two sections dealing with exceptions:

- Exception Call Tree

This section is similar to the Reverse Call Tree Report, but it adds information about how exceptions are handled.
--------------------------

[225]
GFiles.SaveText (1099i)
GFiles.TTextFile.Create (657i)
... Protected code
-- Line 664-684 EInOutError
..[216]
SysUtils.StrLen (6519i)
GFiles.TTextFile.PutLine (792i)
GFiles.GetIOErrorStr (232i)
..[216]

-------------------------

In this report excerpt we can deduct that the Create constructor of the TTextFile class, is protected. The try-except block catches the EInOutError exception. The other routines do not have any try-except blocks that catch exceptions.

- Raised exceptions

This section lists which exceptions that are explicitly raised in the source code (with the keyword "raise").

Example of output for this report section:

--------------------------
EOwnHandledError in PSrcMod (1125)
Exception in GFiles (1339)
--------------------------

New Similarity Report
This new report produces listings of identifiers that have similar names. It does so by using the well-known soundex algorithm. You may use this report to determine how close your identifiers are by name.

New Module Totals Report
This new report produces similar results as the Totals Report, but divided for each module (unit).

New section in Duplicate Identifiers Report
This new section also lists duplicate identifiers, but only those in overlapping scope. These identifiers are most likely to cause problems, if they are confused with each other.

New command line options for PALCMD.EXE
There is a whole new bunch of command line options for PALCMD, which will override settings from PAL.INI:

/F specifies the report format (text, HTML, XML)

/S specifies a semicolon-delimited list of search folders, like /S="C:\CODE1;C:\My Code"

/T specifies the number of report threads to use

/L specifies the path to a text file with limit info

This last option demands a more detailed explanation: You can now use a text file with limit information, which determine the maximum values for sections in reports.

For example, if the file contains just this line:

WARN1=5

.. "WARN1" is the abbreviation for the section "'Interfaced identifiers that are used, but not outside of unit" in the Warnings Report.

If then the number of warnings in a particular run of PALCMD.EXE exceeds 5, PALCMD.EXE will write out an error, and halt with an exit code of 99, and with an error message. You can use this when integrating PAL with your build process, to alert when any unexpected results occur.

Speed improvements

There are a number of improvements, allowing for faster parsing of source code. For example, include files are now cached, so that their content does not need to be read from disk repeatedly.

The building of reports is also much faster, due to a more efficient handling of the data structures generated during parsing, and to the new ability mentioned earlier to build reports in threads. Expect to see speed increases from 10% and upwards.

These speed improvements exist both in the GUI program PAL.EXE and the command-line program PALCMD.EXE.

Miscellaneous

- There is a new option in the settings dialog that when set will let PAL inform when new versions (even minor updates) are available for download.

- The organization and overall design of the project properties dialog has been improved.

- Environment variables can be used to set different options, like the path to the main file, or the folders that should be searched for source code.

- Normally PAL will suggest saving a file in the folder that is defined as the project folder. But you can now select an option, that lets PAL suggest the same folder as the folder in which the main file for the project is located. This is desirable if you like me want to keep the project file together with the source code it analyses.

- It is now possible to select the font and background color for the report tree.