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. |
|
encoding | encoding used for the XML output document.
Only useful with xml . |
No |
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 |
scopeincludeslist | the name of a package, class, or feature must match an entry in the named files for it to be accounted in the report. | No |
scopeexcludeslist | the name of a package, class, or feature must NOT match any of the entries in the named files for it to be accounted in the report. | No |
filterincludeslist | the name of a package, class, or feature at the other end of the dependency must match match an entry in the named files for the dependency to be accounted in the report. | No |
filterexcludeslist | the name of a package, class, or feature at the other end of the dependency must NOT match any of the entries in the named files for the dependency to be accounted in the report. | No |
showallmetrics | include metrics on classes and methods that were not analysed directly, but may still have valid information gathered indirectly from other classes, such as inbound dependencies. | No; defaults to false. |
showemptymetrics | include entries where analysis didn't gather any information. | No; defaults to false. |
showhiddenmeasurements | show all measurements, even if they were meant to be hidden through their visiblity in the configuration. This is useful when trying to debug a complex configuration and tracking the flow of information. | No; defaults to false. |
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-2004 Jean Tessier. All rights reserved.