|
MAudit
RequirementsThis task requires Metamata Development environment 2.0/Webgain Quality Analyzer 2.0. An evaluation version is available at Webgain. , Jakarta Oro and a XML parser (via JAXP). DescriptionInvokes the Metamata Audit/ Webgain Quality Analyzer on a set of Java files. maudit performs static analysis of the Java source code and byte code files to find and report errors of style and potential problems related to performance, maintenance and robustness. . As a convenience, a stylesheet is given in etc directory, so that an HTML report can be generated from the XML file. Parameters
Nested elementsjvmargAdditional parameters may be passed to the VM via nested
You can avoid using the metamata.classpath= metamata.sourcepath= metamata.baseclasspath= classpathSets class path (also source path unless one explicitly set). Overrides METAPATH/CLASSPATH environment variables. The classpath element represents a PATH like structure. sourcepathSets source path. Overrides the SOURCEPATH environment variable. The sourcepath element represents a PATH like structure. sourcepathSets the search path to use as the use domain when looking for unused global declarations. The searchpath element represents a PATH like structure. filesetSets the Java files to audit via a FILESET structure. Whatever the filter is, only the files that ends with .java will be included for processing. Note that the base directory used for the fileset MUST be the root of the source files otherwise package names deduced from the file path will be incorrect. Examplemetamatahome="c:/metamata" fix="yes"> <classpath> <pathelement location="c:/metamata/examples/auditexamples"/> </classpath> <sourcepath> <pathelement location="c:/metamata/examples/auditexamples"/> </sourcepath> <fileset dir="c:/metamata/examples/auditexamples"> <include name="*.java"/> </fileset> </maudit>This invokes Metamata Audit installed in c:/metamata on the audit examples and fix automatically the fixable errors. Generating a reportAs a convenience, there is an XSL file(mmetrics-frames.xsl) that allows you to generate a full framed HTML report of the metrics. You can find it in the etc directory of Ant. As it uses the Xalan redirect extensions, you will need Xalan and Xerces to run it. The stylesheet takes an output.dir parameter (otherwise it will be generated in the current directory), it can be run in Ant as follows:<param name="output.dir" expression="${report.dir}"/> </style> Copyright © 2001-2002 Apache Software Foundation. All rights Reserved. |