| By Bob Hendry | Article Rating: |
|
| October 1, 2002 12:00 AM EDT | Reads: |
13,818 |
PB Code Analyzer is a suite of useful development tools that works with all recent versions of PowerBuilder. Some of the more notable tools allow developers to check coding standards, create user reports, view object relationships (cross-references), document code, search objects, and view PBDebug and SQL trace files.
The program comes as a single setup executable of about 6MB and can be installed on any MS Windows platform without any additional files or programs. The user interface is a standard MDI application that provides access to various menu items and configuration settings and from which you can launch the individual tools.
Code Analyzer
The Code Analyzer (see Figure 1) scans the application code and checks for developer, corporate, and date standards. It then provides a detailed, easy-to-read report so the code can be modified to comply with the imposed standards. The Code Analyzer can be configured to search for developer-defined standards, or it can simply use the default ones provided. The default standards conform to the ones used in the PFC as well as other widely accepted default PowerBuilder standards, including naming conventions.
The Code Analyzer has the ability to search the code for just a few standards, or do an in-depth search that checks virtually every possible property of every object type and script. Any custom settings may be saved into preference files. By having the ability to save different preferences, the developer can quickly switch (and search) between different coding standards.
In addition, the Code Analyzer can be configured to check every object in the application or just a select few. In some cases, it doesn't make sense to analyze the PFC (or your own framework) in each project or to analyze a third-party framework with different coding standards. The analysis goes fairly quickly, even for large projects. When complete, reports are generated that display all the found issues. Filters can be applied to the printed report if needed.
Metric Reports
With the various metric reports, the application can be quickly documented and problem areas can be reported. Some of the included reports are Library Object Directory, Library Object and Variable Dispersion, Object Methods, Script and Comment Metrics, Unused Instance and Local Variables, and Unused Objects.
Object Cross-Reference Finder
With the advanced object cross-reference utility, object relationships can be determined. This is especially useful when determining the impact of changing or deleting a specific object.
Object Exporter
With this documentation tool, objects can be exported into text, HTML, or PowerBuilder Export (*.srx) files. It's very simple to generate technical design documents or Web pages for your entire application or just for selected objects.
Object Searcher
This tool allows you to scan all objects for certain strings. When the search is finished, all objects that contain that string are displayed, as well as their exact location and the context.
Table Locator
The table locator is used to scan functions and events for embedded SQL. If it finds any, it lists the table name and where it is located (the library, object, function/event name). It also lists the tables that are used in each of the DataWindow objects. This is useful if you want to modify or delete a database table - you can search all the objects to see where and how it's used to better understand the impact of the table change.
Variable Locator
The types, scopes, DataWindow retrieval arguments, and DataWindow columns can be searched and identified. The results are listed in a report showing their location, scope, and type.
Object Browser
With the object browser, you can quickly view the object properties and underlying source code. This is similar to the one provided with newer versions of PowerBuilder, but, in most cases, offers more information.
PBDebug and SQL Trace File Viewers
These tools parse and display the output from the PB and SQL trace files. By using the viewers, you can quickly and easily navigate these oftentimes unmanageable files.
INI Maintenance
Another useful tool for older versions of PowerBuilder is the PB INI . It loads all the projects from the PB.INI and checks whether the specified application exists within the given PBL. For "broken" entries, you can either delete the INI entry or "fix" it, which means that invalid PBLs are removed from the library search path.
Final Thoughts
PB Code Analyzer is an easy-to-use, yet powerful utility that helps you conform to your coding standards and assists you in developing well-written and easily maintainable code. You'll be amazed at the nonstandard items this tool will find in your applications. As it comes with a 15-day trial period, you have nothing to lose by downloading it and giving it a try.
Published October 1, 2002 Reads 13,818
Copyright © 2002 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Bob Hendry
Bob Hendry is a PowerBuilder instructor for Envision Software Systems and a frequent speaker at national and international PowerBuilder conferences. He specializes in PFC development and has written two books on the subject, including Programming with the PFC 6.0.
![]() |
xz2641 08/16/03 04:15:50 AM EDT | |||
asd |
||||
![]() |
xz2641 08/16/03 04:14:51 AM EDT | |||
![]() |
ybrowser at http://www.crystalbyte.com 05/15/03 09:10:00 AM EDT | |||
try ybrowser & ysense at http://www.crystalbyte.com it is the most powerful browsing environment for powerbuilder available... |
||||
![]() |
xiaoshangde 01/15/03 05:38:00 AM EST | |||
![]() |
yi xinxu 11/18/02 07:43:00 PM EST | |||


