This task requires Metamata Development environment 2.0/Webgain Quality Analyzer 2.0. An evaluation version is available at Webgain. (Though you will not be able to use Metrics from the command line if you do not have a registered version). You also need a TRaX compliant processor(such as Xalan 2.x) via JAXP 1.1
Invokes the Metamata Metrics / WebGain Quality Analyzer source code analyzer on a set of Java files.
mmetrics will compute the metrics of a set of Java files and write the results to an XML file. As a convenience, a stylesheet is given in etc directory, so that an HTML report can be generated from the XML file.
Attribute | Description | Required |
metamatahome | The home directory containing the Metamata distribution. | Yes |
tofile | The XML were the resulting metrics will be written to. | Yes |
granularity | Metrics granularity of the source files. Must be either files (compilation-units), types (types and compilation-units) or methods (methods, types and compilation-units). | Yes |
maxmemory | Set the maximum memory for the JVM. this is a convenient way to set the -mx or -Xmx argument. | No |
Additional parameters may be passed to the VM via nested <jvmarg>
attributes. <jvmarg>
allows all attributes described in Command
line arguments.
Sets class path (also source path unless one explicitly set). Overrides METAPATH/CLASSPATH environment variables. The classpath element represents a PATH like structure.
Sets source path. Overrides the SOURCEPATH environment variable. The sourcepath element represents a PATH like structure.
Sets the list of directories to analyze the code for metrics.;It represents a PATH structure.
Sets a set of files to analyze for metrics.source It represents a FILESET structure.
Note: For the sake of readability, it is highly recommended to analyze for a single unique directory instead than using filesets or several directories. Otherwise there will be multiple metrics outputs without any way to know what metrics refers to what source. Chance are also that the XML handler that does some heuristic will be confused by the different outputs.
<mmetrics tofile="mmetrics.xml" metamatahome="c:/metamata" granularity="methods"> <classpath> <pathelement location="c:/metamata/examples/metricsexamples"/> </classpath> <sourcepath> <pathelement location="c:/metamata/examples/metricsexamples"/> </sourcepath> <path> <pathelement location="c:/metamata/examples/metricsexamples"/> </path> </mmetrics>
This invokes Metamata Metrics installed in c:/metamata on the metrics example. (Note that here, classpath and sourcepath are not normally not needed)
<style in=java "${metrics.xml}" style="mmetrics-frames.xsl" out="null.tmp"> <param name="output.dir" expression="${report.dir}"/> </style>
Copyright © 2001-2002,2004 The Apache Software Foundation. All rights Reserved.