Computes object-oriented metrics on a codebase.
Computes a number of object-oriented software metrics from a JAR file, such as methods per class and depth of inheritance. It can aggregate values at the class, package, and / or project level.
The normal output is the complete metrics report, sorted by whatever
measurement you specified with sort
. This text report can be
quite large. The file you pointed to with the <destprefix>
attribute will have a .txt
extension.
With the csv
attribute, it maps the structure to comma-separated
values file that can be fed to MS Excel. It can generate up to four files, one
for each group of metrics, based on the <destprefix>
attribute:
With the xml
attribute, it converts the entire structure
into an XML document that follows the
metrics
DTD. The file you pointed to with the <destprefix>
attribute will have a .xml
extension.
Attribute | Description | Required |
projectmetrics | include project-related metrics. | Yes, at least one of these |
groupmetrics | include group- and package-related metrics. | |
classmetrics | include class-related metrics. | |
methodmetrics | include method-related metrics. | |
allmetrics | shortcut for projectmetrics ,
groupmetrics ,
classmetrics and
methodmetrics . |
|
destprefix | where to write the output. The rest of the name depends on the output format. If the file does not exists, it is created. If it already exists, its content is overwritten. | Yes |
txt | writes a single text report with all requested sections. | Yes, at least one of these |
csv | writes each section in its own CSV file, perfect for loading in Microsoft Excel and charting. | |
xml | writes the dependency graph as an XML document with the
dependencies
DTD. |
|
dtdprefix | prefix of the DTD URL for the XML output document.
Only useful with xml . |
No |
indenttext | used for each indentation level in textual and XML output. | No |
configuration | the file with set of measurements to monitor on the codebase and list in the output report. See the user manual for the format of this file and how to customize it. | Yes |
validate | validate the configuration XML against its DTD. | No |
projectname | project name for the report. | No |
sort | Sort the elements based on the value of their measurement named after the value of this attribute. This is the short name defined in the configuration file. By default, sorts in ascending order of package, class, or method name (fully qualified). | No |
reverse | when used with <sort> , sorts in descending order. |
No |
expand | lists the elements in NameListMeasurement
and AccumulatorMeasurement measurements. |
No |
Use nested path
elements to specify file names of JAR files,
Zip files, and .class
files for the tool to read. You can also
give directory names, the tool will search it for .class
files
and read them. It is a
path-like structures.
To scan the current directory and its subdirectories for
.class
files to analyze and save the resulting metrics
report to metrics.xml
:
<oometrics allmetrics="yes" xml="yes" configuration="${dependencyfinder.home}/etc/MetricsConfig.xml" destprefix="metrics"> <path> <pathelement location="."/> </path> </oometrics>
To analyze Dependency Finder and save the resulting metrics
report to df.xml
:
<oometrics allmetrics="yes" xml="yes" configuration="${dependencyfinder.home}/etc/MetricsConfig.xml" projectname="Dependency Finder" destprefix="df"> <path> <pathelement location="20020711\lib\DependencyFinder.jar"/> </path> </oometrics>
To analyze Dependency Finder and save the resulting metrics
report to df.txt
:
<oometrics allmetrics="yes" txt="yes" configuration="${dependencyfinder.home}/etc/MetricsConfig.xml" projectname="Dependency Finder" destprefix="df"> <path> <pathelement location="20020711\lib\DependencyFinder.jar"/> </path> </oometrics>
Copyright © 2001-2003 Jean Tessier. All rights reserved.