Wednesday, December 07, 2005

Counting lines of code

Need to generate lines of code statistics for your project? For PowerBuilder, you're best served by PBL Peeper or Visual Expert. It's not immediately obvious how to do it with PBL Peeper, but if you go to Lists, then Scripts, and then select View->Show from the menu, you'll be presented with a dialog that allows you to add Line Count to the report.

If you've got to count lines of code for anything else, you might want to check out Code Counter Pro. Somewhat similar to SlickEdit, you define for a particular file extension how to distnguish between code lines and comment lines.

Then for a particular analysis you select the different file extensions that should be analyzed.

If your PowerBuilder project is under source control and you don't have "Delete PowerBuilder generated object files" checked in the source control settings, you could easily run Code Counter Pro on the PowerBuilder source files (they're generated by the source control system in the directory with the PBLs). The issue is that Code Counter Pro will include all of the system generated code lines as well (create and destroy scripts, etc.). Generally that's not the information that people are looking for when they are looking for code line counts for PowerBuilder projects.

About Me

Bruce Armstrong is a development lead with Integrated Data Services (IDS). Prior to joining IDS 14 years ago, he was an independent consultant for 15 years doing PowerBuilder development for companies such as Rockwell, Hughes, Boeing, Western Asset Management, Investment Technology Group and Johnson & Johnson. He has been using PowerBuilder since version 1.0.B. He was a charter member of TeamSybase (formerly TeamPS), a PowerBuilder MVP, an SAP Mentor and now and Appeon MVP. He was a contributing author to SYS-CON's PowerBuilder 4.0 Secrets of the Masters and the editor of SAMs' PowerBuilder 9: Advanced Client/Server Development. He has contributed numerous articles to the PowerBuilder Developer's Journal (PBDJ) and the ISUG Tech Journal. He served as the editor-in-chief of PBDJ from 2004 to 2013 and served for a while as a technical editor for the ISUG Tech Journal. He has done sessions on PowerBuilder at most TechWaves, SAP TechEd and Appeon Elevate conferences since 2004, at local user group meetings in Columbia, Germany, Belgium, Switzerland, England, Italy and France and numerous webcasts.