Global Metric Counts

This utility counts the number of projects, modules and objects in the entire database. It is a simple script that is either run from a menu or loaded into the database DXL interaction window

There is a Boolean constant in the code that, if set, will print out the names of the folders and modules being searched. This is useful for debugging and for looking to see where any DXL attribute errors are located (if present, then these will be made visible when the module is opened by the script).

It doesn’t use recursion to delve down through the database structure but uses the itemRef in a ‘for’ loop through each project. This means that the order will be different to the hierarchy but since we are only interested in counts then that’s not a problem.

It will exclude deleted objects, deleted modules and deleted projects. The results are displayed in the DXL interaction window.

Global Metric Count Tool – DXL Interaction window output

The script opens up every module in the database so it can take a long time. A progress bar is therefore used to display the current position in searching through the database.

Gblobal Metric Count tool – Progress Bar

But perhaps the most significant aspect of this tool is that it can be easily adapted to collect other information as it parses its way through the projects and modules.