Metrics code samples
- MetricsPopulate
This sample is a base class that the examples use to inherit code. This class is a key to the framework interface implementation. - Comment Lines
This example shows how to define a new metric for calculating the percentage of lines in a file that are comment lines. - MetricsPopulateCommentRatioByAttributes
This sample code uses metadata values collected by Rational Asset Analyzer for COBOL, PL/I, and Assembler files to calculate percentage of comment lines. - MyNewAttribute
This example shows how to define and populate a new metric for files using the product-provided metrics framework. - XML metrics
This example shows how to calculate the depth of nested nodes and the total number of elements and attributes in XML files, providing a measure of complexity of XML files. - MetricsPopulateCobolCommentRatioByScanningSource
This sample illustrates how to retrieve source from Rational Asset Analyzer.
Parent topic: Defining and reporting additional metrics