Perhaps you've already heard of Visual Expert. If not, it's well worth looking at. Basically it's a code analysis and reporting tool for PowerBuilder applications. There are a large number of features in the product, too many to cover in a single blog posting. Today I just want to focus on three that I use extensively.
The tool examines the code and locates functions, attributes, variables, function parameters and event parameters scripts to determine when there are variable declarations that are no longer used. It's very useful if the application is a bit older or has gone through major rework and you're no longer sure what's actually being used.
The Unused Components analysis does for objects in an application what the Dead Code analysis does for code in objects. You have to be a lot more careful with this one though. If the objects are referenced dynamically, the tool has no way of determining the reference. For example, many of the objects reported in this analysis are referenced as a result of data coming from the database (the database contains the object references). Still, it gives you a good start on determining where you should start looking for dead objects.
If your development shop is rigorous about following coding guidelines (mine is), the Development Rules analysis comes in real handy. If I'm working on some major modifications or some large new functionality, I find it all too easy to skip over doing stuff like adding script headers until the code is complete. The problem is, once the code is complete I'm not really sure where I have addressed the guidelines and where I haven't. The Development Rules analysis tells me exactly where I need to revisit.