You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2014/08/27 00:43:51 UTC

[20/51] [partial] Refactored the PMD Maven build - Adjusted the directory structure - Fixed a lot of compile problems - Fixed the maven setup - Made PMD build with Flexmojos 7.1.0 and Apache Flex 4.13.0 - Fixed a few UnitTests

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/pom.xml b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/pom.xml
new file mode 100644
index 0000000..e078358
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/pom.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.flex.pmd</groupId>
+        <artifactId>flex-pmd-java</artifactId>
+        <version>1.3-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>flex-pmd-metrics-maven-plugin</artifactId>
+    <packaging>maven-plugin</packaging>
+
+    <name>Adobe Flex Metrics Maven plugin</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+            <version>${maven-plugin-api.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.reporting</groupId>
+            <artifactId>maven-reporting-impl</artifactId>
+            <version>${maven-reporting-impl.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-pmd-plugin</artifactId>
+            <version>${maven-pmd-plugin.version}</version>
+            <type>maven-plugin</type>
+        </dependency>
+
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <version>${project.parent.version}</version>
+            <artifactId>flex-pmd-metrics</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>${project.parent.groupId}</groupId>
+            <artifactId>flex-pmd-test-resources</artifactId>
+            <version>${project.parent.version}</version>
+            <classifier>resources</classifier>
+            <type>zip</type>
+            <scope>provided</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+
+        <testResources>
+            <testResource>
+                <directory>${project.build.directory}/test/generated-resources</directory>
+            </testResource>
+        </testResources>
+
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack-test-resources</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeGroupIds>${project.groupId}</includeGroupIds>
+                            <includes>**/*.as,**/*.mxml</includes>
+                            <outputDirectory>${project.build.directory}/test/generated-resources</outputDirectory>
+                            <excludeTransitive>true</excludeTransitive>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsMojo.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsMojo.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsMojo.java
new file mode 100644
index 0000000..323c976
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsMojo.java
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.adobe.ac.pmd.metrics.maven;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Node;
+import org.dom4j.io.SAXReader;
+
+import com.adobe.ac.pmd.LoggerUtils;
+
+/**
+ * @author xagnetti
+ * @goal check
+ * @execute goal="metrics"
+ */
+public final class FlexMetricsMojo extends AbstractMojo
+{
+   /**
+    * CCN Limit, any code with a ccn greater than this number will generate a
+    * violation
+    * 
+    * @parameter default-value="10"
+    * @required
+    */
+   private int     ccnLimit;
+
+   /**
+    * Whether to fail the build if the validation check fails.
+    * 
+    * @parameter default-value="false"
+    * @required
+    */
+   private boolean failOnViolation;
+
+   /**
+    * ncss Limit, any code with a ncss greater than this number will generate a
+    * violation
+    * 
+    * @parameter default-value="100"
+    * @required
+    */
+   private int     ncssLimit;
+
+   /**
+    * Specifies the location of the source files to be used.
+    * 
+    * @parameter expression="${project.build.sourceDirectory}"
+    * @required
+    * @readonly
+    */
+   private File    sourceDirectory;
+
+   /**
+    * Name of the file holding the xml file generated by JavaNCSS
+    * 
+    * @parameter default-value="javancss-raw-report.xml"
+    * @required
+    */
+   private String  tempFileName;
+
+   /**
+    * Specifies the directory where the XML report will be generated.
+    * 
+    * @parameter default-value="${project.build.directory}"
+    * @required
+    */
+   private File    xmlOutputDirectory;
+
+   public FlexMetricsMojo()
+   {
+      super();
+   }
+
+   public FlexMetricsMojo( final File outputDirectoryToBeSet,
+                           final File sourceDirectoryToBeSet )
+   {
+      super();
+      xmlOutputDirectory = outputDirectoryToBeSet;
+      sourceDirectory = sourceDirectoryToBeSet;
+   }
+
+   @SuppressWarnings("unchecked")
+   public void execute() throws MojoExecutionException,
+                        MojoFailureException
+   {
+      new LoggerUtils().loadConfiguration();
+      if ( sourceDirectory != null
+            && sourceDirectory.exists() )
+      {
+         final Set< String > ccnViolation = new HashSet< String >();
+         final Set< String > ncssViolation = new HashSet< String >();
+         final List< Node > methodList = loadDocument().selectNodes( "//javancss/functions/function" );
+
+         for ( final Node node : methodList )
+         {
+            if ( Integer.valueOf( node.valueOf( "ccn" ) ) > ccnLimit )
+            {
+               ccnViolation.add( node.valueOf( "name" ) );
+            }
+            if ( Integer.valueOf( node.valueOf( "ncss" ) ) > ncssLimit )
+            {
+               ncssViolation.add( node.valueOf( "name" ) );
+            }
+         }
+         reportViolation( "ccn",
+                          ccnViolation,
+                          ccnLimit );
+         reportViolation( "ncss",
+                          ncssViolation,
+                          ncssLimit );
+      }
+   }
+
+   public void setCcnLimit( final int ccnLimitToBeSet )
+   {
+      ccnLimit = ccnLimitToBeSet;
+   }
+
+   public void setFailOnViolation( final boolean failOnViolationToBeSet )
+   {
+      failOnViolation = failOnViolationToBeSet;
+   }
+
+   public void setNcssLimit( final int ncssLimitToBeSet )
+   {
+      ncssLimit = ncssLimitToBeSet;
+   }
+
+   public void setTempFileName( final String tempFileNameToBeSet )
+   {
+      tempFileName = tempFileNameToBeSet;
+   }
+
+   public void setXmlOutputDirectory( final File xmlOutputDirectoryToBeSet )
+   {
+      xmlOutputDirectory = xmlOutputDirectoryToBeSet;
+   }
+
+   private Document loadDocument() throws MojoFailureException
+   {
+      final File ncssXmlFile = new File( xmlOutputDirectory
+            + File.separator + tempFileName );
+      try
+      {
+         return new SAXReader().read( ncssXmlFile );
+      }
+      catch ( final DocumentException de )
+      {
+         throw new MojoFailureException( "Can't read javancss xml output file : "
+               + ncssXmlFile, de );
+      }
+   }
+
+   private void reportViolation( final String statName,
+                                 final Set< String > violationSet,
+                                 final int limit ) throws MojoFailureException
+   {
+      getLog().debug( statName
+            + " Violation = " + violationSet.size() );
+      if ( !violationSet.isEmpty() )
+      {
+         final String violationString = "Your code has "
+               + violationSet.size() + " method(s) with a " + statName + " greater than " + limit;
+         getLog().warn( violationString );
+         final Iterator< String > iterator = violationSet.iterator();
+         while ( iterator.hasNext() )
+         {
+            getLog().warn( "    "
+                  + iterator.next() );
+         }
+         if ( failOnViolation )
+         {
+            throw new MojoFailureException( violationString );
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsReportMojo.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsReportMojo.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsReportMojo.java
new file mode 100644
index 0000000..ffc3497
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsReportMojo.java
@@ -0,0 +1,414 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.adobe.ac.pmd.metrics.maven;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.reporting.MavenReportException;
+import org.codehaus.doxia.site.renderer.SiteRenderer;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.io.SAXReader;
+
+import com.adobe.ac.pmd.LoggerUtils;
+import com.adobe.ac.pmd.metrics.maven.generators.NcssAggregateReportGenerator;
+import com.adobe.ac.pmd.metrics.maven.generators.NcssReportGenerator;
+import com.adobe.ac.pmd.metrics.maven.utils.ModuleReport;
+import com.adobe.ac.pmd.metrics.maven.utils.NcssExecuter;
+
+/**
+ * @author xagnetti
+ * @goal metrics
+ */
+public final class FlexMetricsReportMojo extends AbstractMavenReport
+{
+   private static final String OUTPUT_NAME = "javancss";
+
+   private static ResourceBundle getBundle()
+   {
+      return ResourceBundle.getBundle( "flexMetrics" ); // NOPMD
+   }
+
+   /**
+    * Specifies the maximum number of lines to take into account into the
+    * reports.
+    * 
+    * @parameter default-value="5"
+    * @required
+    */
+   private int                  lineThreshold;
+
+   /**
+    * Specifies the factor the mxml files nb of lines will be taken into account
+    * 
+    * @parameter default-value="0"
+    * @required
+    */
+   private double               mxmlFactor;
+
+   /**
+    * Specifies the directory where the HTML report will be generated.
+    * 
+    * @parameter expression="${project.reporting.outputDirectory}"
+    * @required
+    * @readonly
+    */
+   private File                 outputDirectory;
+
+   /**
+    * @parameter expression="${project}"
+    * @required
+    * @readonly
+    */
+   private MavenProject         project;
+
+   /**
+    * The projects in the reactor for aggregation report.
+    * 
+    * @parameter expression="${reactorProjects}"
+    * @readonly
+    */
+   private List< MavenProject > reactorProjects;
+   /**
+    * @parameter 
+    *            expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}"
+    * @required
+    * @readonly
+    */
+   private SiteRenderer         siteRenderer;
+
+   /**
+    * Specifies the location of the source files to be used.
+    * 
+    * @parameter expression="${project.build.sourceDirectory}"
+    * @required
+    * @readonly
+    */
+   private File                 sourceDirectory;
+
+   /**
+    * Specified the name of the temporary file generated by Javancss prior
+    * report generation.
+    * 
+    * @parameter default-value="javancss-raw-report.xml"
+    * @required
+    */
+   private String               tempFileName;
+
+   /**
+    * Specifies the directory where the XML report will be generated.
+    * 
+    * @parameter default-value="${project.build.directory}"
+    * @required
+    */
+   private File                 xmlOutputDirectory;
+
+   public FlexMetricsReportMojo()
+   {
+      super();
+   }
+
+   public FlexMetricsReportMojo( final MavenProject projectToBeSet,
+                                 final File source,
+                                 final File output )
+   {
+      this();
+      project = projectToBeSet;
+      sourceDirectory = source;
+      outputDirectory = output;
+   }
+
+   public void addReactorProject( final MavenProject project )
+   {
+      if ( reactorProjects == null )
+      {
+         reactorProjects = new ArrayList< MavenProject >();
+      }
+      reactorProjects.add( project );
+   }
+
+   /**
+    * @see org.apache.maven.reporting.MavenReport#execute(java.util.Locale)
+    */
+   @Override
+   public void executeReport( final Locale locale ) throws MavenReportException
+   {
+      new LoggerUtils().loadConfiguration();
+      if ( sourceDirectory != null )
+      {
+         if ( sourceDirectory.exists() )
+         {
+            try
+            {
+               generateSingleReport();
+            }
+            catch ( final DocumentException e )
+            {
+               throw new MavenReportException( e.getMessage(), e );
+            }
+            catch ( final IOException e )
+            {
+               throw new MavenReportException( e.getMessage(), e );
+            }
+         }
+         else
+         {
+            getLog().error( "The source directory is not found "
+                  + sourceDirectory.getAbsolutePath() );
+         }
+      }
+      else
+      {
+         generateAggregateReport( locale );
+      }
+   }
+
+   /**
+    * @see org.apache.maven.reporting.MavenReport#getDescription(java.util.Locale)
+    */
+   public String getDescription( final Locale locale )
+   {
+      return getBundle().getString( "report.ncss.description" );
+   }
+
+   /**
+    * @see org.apache.maven.reporting.MavenReport#getName(java.util.Locale)
+    */
+   public String getName( final Locale locale )
+   {
+      return getBundle().getString( "report.ncss.name" );
+   }
+
+   /**
+    * @see org.apache.maven.reporting.MavenReport#getOutputName()
+    */
+   public String getOutputName()
+   {
+      return OUTPUT_NAME;
+   }
+
+   public void setLineThreshold( final int lineThresholdToBeSet )
+   {
+      lineThreshold = lineThresholdToBeSet;
+   }
+
+   public void setSiteRenderer( final SiteRenderer siteRendererToBeSet )
+   {
+      siteRenderer = siteRendererToBeSet;
+   }
+
+   public void setTempFileName( final String tempFileNameToBeSet )
+   {
+      tempFileName = tempFileNameToBeSet;
+   }
+
+   public void setXmlOutputDirectory( final File xmlOutputDirectoryToBeSet )
+   {
+      xmlOutputDirectory = xmlOutputDirectoryToBeSet;
+   }
+
+   /**
+    * Build a path for the output filename.
+    * 
+    * @return A String representation of the output filename.
+    */
+   /* package */File buildOutputFile()
+   {
+      return new File( getXmlOutputDirectory()
+            + File.separator + tempFileName );
+   }
+
+   /**
+    * @see org.apache.maven.reporting.AbstractMavenReport#getOutputDirectory()
+    */
+   @Override
+   protected String getOutputDirectory()
+   {
+      return outputDirectory.getAbsolutePath();
+   }
+
+   /**
+    * @see org.apache.maven.reporting.AbstractMavenReport#getProject()
+    */
+   @Override
+   protected MavenProject getProject()
+   {
+      return project;
+   }
+
+   /**
+    * @see org.apache.maven.reporting.AbstractMavenReport#getSiteRenderer()
+    */
+   @Override
+   protected SiteRenderer getSiteRenderer()
+   {
+      return siteRenderer;
+   }
+
+   /**
+    * Getter for the source directory
+    * 
+    * @return the source directory as a File object.
+    */
+   protected File getSourceDirectory()
+   {
+      return sourceDirectory;
+   }
+
+   protected String getXmlOutputDirectory()
+   {
+      return xmlOutputDirectory.getAbsolutePath();
+   }
+
+   private void generateAggregateReport( final Locale locale ) throws MavenReportException
+   {
+      final String basedir = project.getBasedir().toString();
+      final String output = xmlOutputDirectory.toString();
+      if ( getLog().isDebugEnabled() )
+      {
+         getLog().debug( "basedir: "
+               + basedir );
+         getLog().debug( "output: "
+               + output );
+      }
+      String relative = null;
+      if ( output.startsWith( basedir ) )
+      {
+         relative = output.substring( basedir.length() + 1 );
+      }
+      else
+      {
+         getLog().error( "Unable to aggregate report because I can't "
+               + "determine the relative location of the XML report" );
+         return;
+      }
+      getLog().debug( "relative: "
+            + relative );
+      final List< ModuleReport > reports = new ArrayList< ModuleReport >();
+
+      if ( reactorProjects != null )
+      {
+         for ( final MavenProject mavenProject : reactorProjects )
+         {
+            final MavenProject child = mavenProject;
+            final File xmlReport = new File( child.getBasedir() // NOPMD
+                  + File.separator + relative, tempFileName );
+            if ( xmlReport.exists() )
+            {
+               reports.add( new ModuleReport( child, loadDocument( xmlReport ) ) ); // NOPMD
+            }
+            else
+            {
+               getLog().debug( "xml file not found: "
+                     + xmlReport );
+            }
+         }
+         getLog().debug( "Aggregating "
+               + reports.size() + " JavaNCSS reports" );
+
+         new NcssAggregateReportGenerator( getSink(), getBundle(), getLog() ).doReport( locale,
+                                                                                        reports,
+                                                                                        lineThreshold );
+      }
+   }
+
+   private void generateSingleReport() throws MavenReportException,
+                                      DocumentException,
+                                      IOException
+   {
+      if ( getLog().isDebugEnabled() )
+      {
+         getLog().debug( "Calling NCSSExecuter with src    : "
+               + sourceDirectory );
+         getLog().debug( "Calling NCSSExecuter with output : "
+               + buildOutputFile() );
+      }
+      // run javaNCss and produce an temp xml file
+      new NcssExecuter( sourceDirectory, buildOutputFile(), mxmlFactor ).execute();
+      if ( !isTempReportGenerated() )
+      {
+         throw new MavenReportException( "Can't process temp ncss xml file." );
+      }
+      // parse the freshly generated file and write the report
+      final NcssReportGenerator reportGenerator = new NcssReportGenerator( getSink(), getBundle(), getLog() );
+      reportGenerator.doReport( loadDocument(),
+                                lineThreshold );
+   }
+
+   /**
+    * Check that the expected temporary file generated by JavaNCSS exists.
+    * 
+    * @return <code>true</code> if the temporary report exists,
+    *         <code>false</code> otherwise.
+    */
+   private boolean isTempReportGenerated()
+   {
+      return buildOutputFile().exists();
+   }
+
+   private Document loadDocument() throws MavenReportException
+   {
+      return loadDocument( buildOutputFile() );
+   }
+
+   /**
+    * Load the xml file generated by javancss. It first tries to load it as is.
+    * If this fails it tries to load it with the forceEncoding parameter which
+    * defaults to the system property "file.encoding". If this latter fails, it
+    * throws a MavenReportException.
+    */
+   private Document loadDocument( final File file ) throws MavenReportException
+   {
+      try
+      {
+         return loadDocument( file,
+                              null );
+      }
+      catch ( final DocumentException ignored )
+      {
+         try
+         {
+            return loadDocument( file,
+                                 System.getProperty( "file.encoding" ) );
+         }
+         catch ( final DocumentException de )
+         {
+            throw new MavenReportException( de.getMessage(), de );
+         }
+      }
+   }
+
+   private Document loadDocument( final File file,
+                                  final String encoding ) throws DocumentException
+   {
+      final SAXReader saxReader = new SAXReader();
+      if ( encoding != null )
+      {
+         saxReader.setEncoding( encoding );
+         getLog().debug( "Loading xml file with encoding : "
+               + encoding );
+      }
+      return saxReader.read( file );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssAggregateReportGenerator.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssAggregateReportGenerator.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssAggregateReportGenerator.java
new file mode 100644
index 0000000..929d939
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssAggregateReportGenerator.java
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.adobe.ac.pmd.metrics.maven.generators;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.doxia.sink.Sink;
+import org.dom4j.Document;
+import org.dom4j.Node;
+
+import com.adobe.ac.pmd.metrics.maven.utils.ModuleReport;
+
+/**
+ * Generates the JavaNCSS aggregate report.
+ *
+ * @author <a href="mperham AT gmail.com">Mike Perham</a>
+ * @version $Id: NcssAggregateReportGenerator.java 3286 2007-02-08 20:18:51Z
+ *          jeanlaurent $
+ */
+public class NcssAggregateReportGenerator extends NcssReportGeneratorBase
+{
+
+    /**
+     * @param getSink() the getSink() which will be used for reporting.
+     * @param bundle the correct RessourceBundle to be used for reporting.
+     * @param log
+     */
+    public NcssAggregateReportGenerator( final Sink sink,
+                                         final ResourceBundle bundle,
+                                         final Log log )
+    {
+        super( sink, bundle, log );
+    }
+
+    /**
+     * Generates the JavaNCSS report.
+     *
+     * @param locale the Locale used for this report.
+     * @param moduleReports the javancss raw reports to aggregate, List of
+     *           ModuleReport.
+     * @param lineThreshold the maximum number of lines to keep in major reports.
+     */
+    public void doReport( final Locale locale,
+                          final List< ModuleReport > moduleReports,
+                          final int lineThreshold )
+    {
+        // HEADER
+        getSink().head();
+        getSink().title();
+        getSink().text( getResourceBundle().getString( "report.javancss.title" ) );
+        getSink().title_();
+        getSink().head_();
+        // BODY
+        getSink().body();
+        doIntro();
+        // packages
+        startSection( "report.javancss.module.link",
+                "report.javancss.module.title" );
+        doModuleAnalysis( moduleReports );
+        endSection();
+        getSink().body_();
+        getSink().close();
+    }
+
+    private void doIntro()
+    {
+        getSink().section1();
+        getSink().sectionTitle1();
+        getSink().text( getResourceBundle().getString( "report.javancss.main.title" ) );
+        getSink().sectionTitle1_();
+        getSink().paragraph();
+        getSink().text( getResourceBundle().getString( "report.javancss.main.text" )
+                + " " );
+        getSink().lineBreak();
+        getSink().link( "http://www.kclee.de/clemens/java/javancss/" );
+        getSink().text( "JavaNCSS web site." );
+        getSink().link_();
+        getSink().paragraph_();
+        getSink().section1_();
+    }
+
+    private void doModuleAnalysis( final List< ModuleReport > reports )
+    {
+        doModuleAnalysisHeader();
+
+        int packages = 0;
+        int classes = 0;
+        int methods = 0;
+        int ncss = 0;
+        int javadocs = 0;
+        int jdlines = 0;
+        int single = 0;
+        int multi = 0;
+        for ( final ModuleReport moduleReport : reports )
+        {
+            final ModuleReport report = moduleReport;
+            final Document document = report.getJavancssDocument();
+            getSink().tableRow();
+            getLog().debug( "Aggregating "
+                    + report.getModule().getArtifactId() );
+            tableCellHelper( report.getModule().getArtifactId() );
+            final int packageSize = document.selectNodes( "//javancss/packages/package" ).size();
+            packages += packageSize;
+            tableCellHelper( String.valueOf( packageSize ) );
+
+            final Node node = document.selectSingleNode( "//javancss/packages/total" );
+
+            tableCellHelper( node.valueOf( "classes" ) );
+            classes += Integer.parseInt( node.valueOf( "classes" ) );
+            tableCellHelper( node.valueOf( "functions" ) );
+            methods += Integer.parseInt( node.valueOf( "functions" ) );
+            tableCellHelper( node.valueOf( "ncss" ) );
+            ncss += Integer.parseInt( node.valueOf( "ncss" ) );
+            tableCellHelper( node.valueOf( "javadocs" ) );
+            javadocs += Integer.parseInt( node.valueOf( "javadocs" ) );
+            tableCellHelper( node.valueOf( "javadoc_lines" ) );
+            jdlines += Integer.parseInt( node.valueOf( "javadoc_lines" ) );
+            tableCellHelper( node.valueOf( "single_comment_lines" ) );
+            single += Integer.parseInt( node.valueOf( "single_comment_lines" ) );
+            tableCellHelper( node.valueOf( "multi_comment_lines" ) );
+            multi += Integer.parseInt( node.valueOf( "multi_comment_lines" ) );
+
+            getSink().tableRow_();
+        }
+
+        doModuleAnalysisTotals( packages,
+                classes,
+                methods,
+                ncss,
+                javadocs,
+                jdlines,
+                single,
+                multi );
+    }
+
+    private void doModuleAnalysisHeader()
+    {
+        getSink().table();
+        getSink().tableRow();
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.module" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.packages" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.classetotal" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.functiontotal" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ncsstotal" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.javadoc" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.javadoc_line" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.single_comment" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.multi_comment" ) );
+        getSink().tableRow_();
+    }
+
+    private void doModuleAnalysisTotals( final int packages,
+                                         final int classes,
+                                         final int methods,
+                                         final int ncss,
+                                         final int javadocs,
+                                         final int jdlines,
+                                         final int single,
+                                         final int multi )
+    {
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.header.totals" ) );
+        tableCellHelper( String.valueOf( packages ) );
+        tableCellHelper( String.valueOf( classes ) );
+        tableCellHelper( String.valueOf( methods ) );
+        tableCellHelper( String.valueOf( ncss ) );
+        tableCellHelper( String.valueOf( javadocs ) );
+        tableCellHelper( String.valueOf( jdlines ) );
+        tableCellHelper( String.valueOf( single ) );
+        tableCellHelper( String.valueOf( multi ) );
+        getSink().tableRow_();
+
+        getSink().table_();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssReportGenerator.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssReportGenerator.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssReportGenerator.java
new file mode 100644
index 0000000..2bbe67e
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssReportGenerator.java
@@ -0,0 +1,464 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.adobe.ac.pmd.metrics.maven.generators;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ResourceBundle;
+
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.doxia.sink.Sink;
+import org.dom4j.Document;
+import org.dom4j.Node;
+
+import com.adobe.ac.pmd.metrics.maven.utils.NumericNodeComparator;
+
+/**
+ * Generates the javaNcss maven report.
+ *
+ * @author <a href="jeanlaurentATgmail.com">Jean-Laurent de Morlhon</a>
+ * @version $Id: NcssReportGenerator.java 3286 2007-02-08 20:18:51Z jeanlaurent
+ *          $
+ */
+public class NcssReportGenerator extends NcssReportGeneratorBase
+{
+    private static final String CLASSES   = "classes";
+    private static final String FUNCTIONS = "functions";
+    private static final String NAME      = "name";
+    private static final String NCSS      = "ncss";
+    private int                 lineThreshold;
+
+    /**
+     * build a new NcssReportGenerator.
+     *
+     * @param sink the sink which will be used for reporting.
+     * @param bundle the correct RessourceBundle to be used for reporting.
+     */
+    public NcssReportGenerator( final Sink sink,
+                                final ResourceBundle bundle,
+                                final Log log )
+    {
+        super( sink, bundle, log );
+    }
+
+    /**
+     * Generates the JavaNcss reports.
+     *
+     * @param document the javaNcss raw report as an XML document.
+     * @param lineThresholdToBeSet the maximum number of lines to keep in major
+     *           reports.
+     */
+    public void doReport( final Document document,
+                          final int lineThresholdToBeSet )
+    {
+        lineThreshold = lineThresholdToBeSet;
+        // HEADER
+        getSink().head();
+        getSink().title();
+        getSink().text( getResourceBundle().getString( "report.javancss.title" ) );
+        getSink().title_();
+        getSink().head_();
+        // BODY
+        getSink().body();
+        doIntro();
+        // packages
+        startSection( "report.javancss.package.link",
+                "report.javancss.package.title" );
+        doMainPackageAnalysis( document );
+        doTotalPackageAnalysis( document );
+        endSection();
+        // Objects
+        startSection( "report.javancss.object.link",
+                "report.javancss.object.title" );
+        doTopObjectNcss( document );
+        doTopObjectFunctions( document );
+        doObjectAverage( document );
+        endSection();
+        // Functions
+        startSection( "report.javancss.function.link",
+                "report.javancss.function.title" );
+        doFunctionAnalysis( document );
+        doFunctionAverage( document );
+        endSection();
+        // Explanation
+        startSection( "report.javancss.explanation.link",
+                "report.javancss.explanation.title" );
+        doExplanation();
+        endSection();
+        getSink().body_();
+    }
+
+    // sink helper to start a section
+    @Override
+    protected void startSection( final String link,
+                                 final String title )
+    {
+        super.startSection( link,
+                title );
+        navigationBar();
+    }
+
+    private void doExplanation()
+    {
+        explainNcss();
+        explainCcn();
+    }
+
+    @SuppressWarnings("unchecked")
+    private void doFunctionAnalysis( final Document document )
+    {
+        subtitleHelper( getResourceBundle().getString( "report.javancss.top" )
+                + " " + lineThreshold + " " + getResourceBundle().getString( "report.javancss.function.byncss" ) );
+        getSink().paragraph();
+        getSink().table();
+        getSink().tableRow();
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.function" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ncss" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ccn" ) );
+        getSink().tableRow_();
+        final List< Node > list = document.selectNodes( "//javancss/functions/function" );
+        Collections.sort( list,
+                new NumericNodeComparator( NCSS ) );
+        final Iterator< Node > nodeIterator = list.iterator();
+        int currentIndex = 0;
+        while ( nodeIterator.hasNext()
+                && currentIndex++ < lineThreshold )
+        {
+            final Node node = nodeIterator.next();
+            getSink().tableRow();
+            // getSink().tableCell();
+            // getSink().tableCell_();
+            tableCellHelper( node.valueOf( "name" ) );
+            tableCellHelper( node.valueOf( NCSS ) );
+            tableCellHelper( node.valueOf( "ccn" ) );
+            getSink().tableRow_();
+        }
+        getSink().table_();
+        getSink().paragraph_();
+    }
+
+    private void doFunctionAverage( final Document document )
+    {
+        subtitleHelper( getResourceBundle().getString( "report.javancss.averages" ) );
+        getSink().paragraph();
+        getSink().table();
+        getSink().tableRow();
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.programncss" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ncssaverage" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ccnaverage" ) );
+        getSink().tableRow_();
+        final Node node = document.selectSingleNode( "//javancss/functions/function_averages" );
+        final String totalNcss = document.selectSingleNode( "//javancss/functions/ncss" ).getText();
+        getSink().tableRow();
+        tableCellHelper( totalNcss );
+        tableCellHelper( node.valueOf( NCSS ) );
+        tableCellHelper( node.valueOf( "ccn" ) );
+        getSink().tableRow_();
+        getSink().table_();
+        getSink().paragraph_();
+    }
+
+    private void doIntro()
+    {
+        getSink().section1();
+        getSink().sectionTitle1();
+        getSink().text( getResourceBundle().getString( "report.javancss.main.title" ) );
+        getSink().sectionTitle1_();
+        getSink().paragraph();
+        navigationBar();
+        getSink().text( getResourceBundle().getString( "report.javancss.main.text" )
+                + " " );
+        getSink().lineBreak();
+        getSink().link( "http://www.kclee.de/clemens/java/javancss/" );
+        getSink().text( "JavaNCSS web site." );
+        getSink().link_();
+        getSink().paragraph_();
+        getSink().section1_();
+    }
+
+    @SuppressWarnings("unchecked")
+    private void doMainPackageAnalysis( final Document document )
+    {
+        subtitleHelper( getResourceBundle().getString( "report.javancss.package.text" ) );
+        getSink().table();
+        getSink().tableRow();
+        // HEADER
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.package" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.classe" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.function" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ncss" ) );
+        getSink().tableRow_();
+        // DATA
+        final List< Node > list = document.selectNodes( "//javancss/packages/package" );
+        Collections.sort( list,
+                new NumericNodeComparator( NCSS ) );
+
+        for ( final Node node : list )
+        {
+            getSink().tableRow();
+            tableCellHelper( node.valueOf( NAME ) );
+            tableCellHelper( node.valueOf( CLASSES ) );
+            tableCellHelper( node.valueOf( FUNCTIONS ) );
+            tableCellHelper( node.valueOf( NCSS ) );
+            getSink().tableRow_();
+        }
+        getSink().table_();
+    }
+
+    private void doObjectAverage( final Document document )
+    {
+        subtitleHelper( getResourceBundle().getString( "report.javancss.averages" ) );
+        getSink().table();
+        getSink().tableRow();
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ncssaverage" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.classeaverage" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.functionaverage" ) );
+        getSink().tableRow_();
+        final Node node = document.selectSingleNode( "//javancss/objects/averages" );
+        getSink().tableRow();
+        tableCellHelper( node.valueOf( NCSS ) );
+        tableCellHelper( node.valueOf( CLASSES ) );
+        tableCellHelper( node.valueOf( FUNCTIONS ) );
+        getSink().tableRow_();
+        getSink().table_();
+    }
+
+    @SuppressWarnings("unchecked")
+    private void doTopObjectFunctions( final Document document )
+    {
+        subtitleHelper( getResourceBundle().getString( "report.javancss.top" )
+                + " " + lineThreshold + " " + getResourceBundle().getString( "report.javancss.object.byfunction" ) );
+        final List< Node > nodeList = document.selectNodes( "//javancss/objects/object" );
+        Collections.sort( nodeList,
+                new NumericNodeComparator( FUNCTIONS ) );
+        doTopObjectGeneric( nodeList );
+    }
+
+    // generic method called by doTopObjectFunctions & doTopObjectNCss
+    private void doTopObjectGeneric( final List< Node > nodeList )
+    {
+        getSink().table();
+        getSink().tableRow();
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.object" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ncss" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.function" ) );
+        getSink().tableRow_();
+        final Iterator< Node > nodeIterator = nodeList.iterator();
+        int currentIndex = 0;
+        while ( nodeIterator.hasNext()
+                && currentIndex++ < lineThreshold )
+        {
+            final Node node = nodeIterator.next();
+            getSink().tableRow();
+            tableCellHelper( node.valueOf( NAME ) );
+            tableCellHelper( node.valueOf( NCSS ) );
+            tableCellHelper( node.valueOf( FUNCTIONS ) );
+            getSink().tableRow_();
+        }
+        getSink().table_();
+    }
+
+    @SuppressWarnings("unchecked")
+    private void doTopObjectNcss( final Document document )
+    {
+        subtitleHelper( getResourceBundle().getString( "report.javancss.top" )
+                + " " + lineThreshold + " " + getResourceBundle().getString( "report.javancss.object.byncss" ) );
+        final List< Node > nodeList = document.selectNodes( "//javancss/objects/object" );
+        Collections.sort( nodeList,
+                new NumericNodeComparator( NCSS ) );
+        doTopObjectGeneric( nodeList );
+    }
+
+    private void doTotalPackageAnalysis( final Document document )
+    {
+        getSink().table();
+        getSink().tableRow();
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.classetotal" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.functiontotal" ) );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.header.ncsstotal" ) );
+        getSink().tableRow_();
+        final Node node = document.selectSingleNode( "//javancss/packages/total" );
+        getSink().tableRow();
+        tableCellHelper( node.valueOf( CLASSES ) );
+        tableCellHelper( node.valueOf( FUNCTIONS ) );
+        tableCellHelper( node.valueOf( NCSS ) );
+        getSink().tableRow_();
+        getSink().table_();
+    }
+
+    private void explainCcn()
+    {
+        subtitleHelper( getResourceBundle().getString( "report.javancss.explanation.ccn.title" ) );
+        paragraphHelper( getResourceBundle().getString( "report.javancss.explanation.ccn.paragraph1" ) );
+        paragraphHelper( getResourceBundle().getString( "report.javancss.explanation.ccn.paragraph2" ) );
+        getSink().list();
+        codeItemListHelper( "if" );
+        codeItemListHelper( "for" );
+        codeItemListHelper( "while" );
+        codeItemListHelper( "case" );
+        codeItemListHelper( "catch" );
+        getSink().list_();
+        paragraphHelper( getResourceBundle().getString( "report.javancss.explanation.ccn.paragraph3" ) );
+        getSink().list();
+        codeItemListHelper( "if" );
+        codeItemListHelper( "for" );
+        getSink().list_();
+        paragraphHelper( getResourceBundle().getString( "report.javancss.explanation.ccn.paragraph4" ) );
+        paragraphHelper( getResourceBundle().getString( "report.javancss.explanation.ccn.paragraph5" ) );
+    }
+
+    private void explainClasses()
+    {
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.class" ) );
+        getSink().tableCell();
+        getSink().list();
+        codeItemListHelper( "public class Foo {" );
+        codeItemListHelper( "public class Foo extends Bla {" );
+        getSink().list_();
+        getSink().tableCell_();
+        getSink().tableRow_();
+
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.interface" ) );
+        codeCellHelper( "public interface Able {" );
+        getSink().tableRow_();
+    }
+
+    private void explainFunction()
+    {
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.method" ) );
+        getSink().tableCell();
+        getSink().list();
+        codeItemListHelper( "public function cry() : void{}" );
+        codeItemListHelper( "public function gib() : DeadResult {}" );
+        getSink().list_();
+        getSink().tableCell_();
+        getSink().tableRow_();
+
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.constructorD" ) );
+        codeCellHelper( "public Foo() {" );
+        getSink().tableRow_();
+
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.constructorI" ) );
+        getSink().tableCell();
+        getSink().list();
+        codeItemListHelper( "super();" );
+        getSink().list_();
+        getSink().tableCell_();
+        getSink().tableRow_();
+    }
+
+    private void explainNcss()
+    {
+        subtitleHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.title" ) );
+        paragraphHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.paragraph1" ) );
+        paragraphHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.paragraph2" ) );
+        getSink().table();
+
+        getSink().tableRow();
+        headerCellHelper( "" );
+        headerCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.examples" ) );
+        getSink().tableRow_();
+
+        explainPackage();
+        explainClasses();
+        explainVariable();
+        explainFunction();
+        explainStatement();
+
+        getSink().table_();
+
+        paragraphHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.paragraph3" ) );
+    }
+
+    private void explainPackage()
+    {
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.package" ) );
+        codeCellHelper( "package com.adobe.ac {}" );
+        getSink().tableRow_();
+
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.import" ) );
+        codeCellHelper( "import com.adobe.ac.*;" );
+        getSink().tableRow_();
+    }
+
+    private void explainStatement()
+    {
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.statement" ) );
+        getSink().tableCell();
+        getSink().list();
+        codeItemListHelper( "i = 0;" );
+        codeItemListHelper( "if (ok)" );
+        codeItemListHelper( "if (exit) {" );
+        codeItemListHelper( "if (3 == 4);" );
+        codeItemListHelper( "if (4 == 4) { ;" );
+        codeItemListHelper( "} else {" );
+        getSink().list_();
+        getSink().tableCell_();
+        getSink().tableRow_();
+    }
+
+    private void explainVariable()
+    {
+        getSink().tableRow();
+        tableCellHelper( getResourceBundle().getString( "report.javancss.explanation.ncss.table.field" ) );
+        getSink().tableCell();
+        getSink().list();
+        codeItemListHelper( "var a : Number;" );
+        codeItemListHelper( "var a : Number = 1;" );
+        getSink().list_();
+        getSink().tableCell_();
+        getSink().tableRow_();
+    }
+
+    // print out the navigation bar
+    private void navigationBar()
+    {
+        getSink().paragraph();
+        getSink().text( "[ " );
+        getSink().link( "#"
+                + getResourceBundle().getString( "report.javancss.package.link" ) );
+        getSink().text( getResourceBundle().getString( "report.javancss.package.link" ) );
+        getSink().link_();
+        getSink().text( " ] [ " );
+        getSink().link( "#"
+                + getResourceBundle().getString( "report.javancss.object.link" ) );
+        getSink().text( getResourceBundle().getString( "report.javancss.object.link" ) );
+        getSink().link_();
+        getSink().text( " ] [ " );
+        getSink().link( "#"
+                + getResourceBundle().getString( "report.javancss.function.link" ) );
+        getSink().text( getResourceBundle().getString( "report.javancss.function.link" ) );
+        getSink().link_();
+        getSink().text( " ] [ " );
+        getSink().link( "#"
+                + getResourceBundle().getString( "report.javancss.explanation.link" ) );
+        getSink().text( getResourceBundle().getString( "report.javancss.explanation.link" ) );
+        getSink().link_();
+        getSink().text( " ]" );
+        getSink().paragraph_();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssReportGeneratorBase.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssReportGeneratorBase.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssReportGeneratorBase.java
new file mode 100644
index 0000000..fcf5997
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/generators/NcssReportGeneratorBase.java
@@ -0,0 +1,220 @@
+/**
+ *    Copyright (c) 2009, Adobe Systems, Incorporated
+ *    All rights reserved.
+ *
+ *    Redistribution  and  use  in  source  and  binary  forms, with or without
+ *    modification,  are  permitted  provided  that  the  following  conditions
+ *    are met:
+ *
+ *      * Redistributions  of  source  code  must  retain  the  above copyright
+ *        notice, this list of conditions and the following disclaimer.
+ *      * Redistributions  in  binary  form  must reproduce the above copyright
+ *        notice,  this  list  of  conditions  and  the following disclaimer in
+ *        the    documentation   and/or   other  materials  provided  with  the
+ *        distribution.
+ *      * Neither the name of the Adobe Systems, Incorporated. nor the names of
+ *        its  contributors  may be used to endorse or promote products derived
+ *        from this software without specific prior written permission.
+ *
+ *    THIS  SOFTWARE  IS  PROVIDED  BY THE  COPYRIGHT  HOLDERS AND CONTRIBUTORS
+ *    "AS IS"  AND  ANY  EXPRESS  OR  IMPLIED  WARRANTIES,  INCLUDING,  BUT NOT
+ *    LIMITED  TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ *    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
+ *    OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,  INCIDENTAL,  SPECIAL,
+ *    EXEMPLARY,  OR  CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT  LIMITED TO,
+ *    PROCUREMENT  OF  SUBSTITUTE   GOODS  OR   SERVICES;  LOSS  OF  USE,  DATA,
+ *    OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ *    LIABILITY,  WHETHER  IN  CONTRACT,  STRICT  LIABILITY, OR TORT (INCLUDING
+ *    NEGLIGENCE  OR  OTHERWISE)  ARISING  IN  ANY  WAY  OUT OF THE USE OF THIS
+ *    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.adobe.ac.pmd.metrics.maven.generators;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ResourceBundle;
+
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.doxia.sink.Sink;
+
+/**
+ * Base abstract class for NCSSReport classes.<br>
+ * It holds essentially helper methods on top of the Sink Doxia object.
+ *
+ * @author <a href="jeanlaurent@NOSPAMgmail.com>Jean-Laurent de Morlhon</a>
+ * @version $Id: AbstractNcssReportGenerator.java 3286 2007-02-08 20:18:51Z
+ *          jeanlaurent $
+ */
+public class NcssReportGeneratorBase
+{
+
+    private final ResourceBundle bundle;
+    private final Log            log;
+    private final Sink           sink;
+
+    /**
+     * build a new NcssReportGenerator.
+     *
+     * @param sinkToBeSet the sink which will be used for reporting.
+     * @param bundleToBeSet the correct RessourceBundle to be used for reporting.
+     * @param logToBeSet the log object enabling logging within maven plugins.
+     */
+    protected NcssReportGeneratorBase( final Sink sinkToBeSet,
+                                       final ResourceBundle bundleToBeSet,
+                                       final Log logToBeSet )
+    {
+        bundle = bundleToBeSet;
+        sink = sinkToBeSet;
+        log = logToBeSet;
+    }
+
+    /**
+     * Getter for the Log instance.
+     *
+     * @return the current log instance associated with this report generator.
+     */
+    public Log getLog()
+    {
+        return this.log;
+    }
+
+    /**
+     * Getter for the RessourceBundle.
+     *
+     * @return the current ResourceBundle associated with this report generator.
+     */
+    public ResourceBundle getResourceBundle()
+    {
+        return this.bundle;
+    }
+
+    /**
+     * Getter for the Sink instance.
+     *
+     * @return the current instance of Sink associated with this report
+     *         generator.
+     */
+    public Sink getSink()
+    {
+        return this.sink;
+    }
+
+    /**
+     * sink helper to write cell containing code.
+     *
+     * @param text the text to write within a cell and within code tags.
+     */
+    protected void codeCellHelper( final String text )
+    {
+        sink.tableCell();
+        sink.monospaced();
+        sink.text( text );
+        sink.monospaced_();
+        sink.tableCell_();
+    }
+
+    /**
+     * sink helper to write a "code" itemList.
+     *
+     * @param test the text to write within the code tags.
+     */
+    protected void codeItemListHelper( final String text )
+    {
+        sink.listItem();
+        sink.monospaced();
+        sink.text( text );
+        sink.monospaced_();
+        sink.listItem_();
+    }
+
+    /**
+     * sink helper to end a section
+     */
+    protected void endSection()
+    {
+        sink.section1_();
+    }
+
+    /**
+     * sink helper to write a simple table header cell.
+     *
+     * @param text the text to write within a table header cell.
+     */
+    protected void headerCellHelper( final String text )
+    {
+        sink.tableHeaderCell();
+        sink.text( text );
+        sink.tableHeaderCell_();
+    }
+
+    /**
+     * sink helper to write a paragrah
+     *
+     * @param the text to write within the paragraph.
+     */
+    protected void paragraphHelper( final String text )
+    {
+        sink.paragraph();
+        sink.text( text );
+        sink.paragraph_();
+    }
+
+    /**
+     * sink helper to start a section.
+     *
+     * @param locale the locale to be used to display text within the section
+     *           start.
+     * @param link the anchor link.
+     * @param title the title of the anchor link.
+     */
+    protected void startSection( final String link,
+                                 final String title )
+    {
+        sink.section1();
+        sink.sectionTitle1();
+        sink.anchor( bundle.getString( link ) );
+        sink.text( bundle.getString( title ) );
+        sink.anchor_();
+        sink.sectionTitle1_();
+    }
+
+    /**
+     * sink helper to write a subtitle
+     *
+     * @param text the text to write as a subtitle.
+     */
+    protected void subtitleHelper( final String text )
+    {
+        sink.paragraph();
+        sink.bold();
+        sink.text( text );
+        sink.bold_();
+        sink.paragraph_();
+    }
+
+    /**
+     * sink helper to write a simple tabke cell.
+     *
+     * @param text the text to write within a table cell.
+     */
+    protected void tableCellHelper( final String text )
+    {
+        sink.tableCell();
+        sink.text( text );
+        sink.tableCell_();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/ModuleReport.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/ModuleReport.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/ModuleReport.java
new file mode 100644
index 0000000..adaf50b
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/ModuleReport.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.adobe.ac.pmd.metrics.maven.utils;
+
+import org.apache.maven.project.MavenProject;
+import org.dom4j.Document;
+
+public final class ModuleReport
+{
+    /**
+     * The MavenProject associated with the report.
+     */
+    private MavenProject module;
+
+    /**
+     * The Report associated with the MavenProject
+     */
+    private Document     report;
+
+    public ModuleReport( final MavenProject project,
+                         final Document document )
+    {
+        module = project;
+        report = document;
+    }
+
+    public Document getJavancssDocument()
+    {
+        return report;
+    }
+
+    public MavenProject getModule()
+    {
+        return module;
+    }
+
+    public void setModule( final MavenProject project )
+    {
+        this.module = project;
+    }
+
+    public void setReport( final Document javancssDocument )
+    {
+        this.report = javancssDocument;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/NcssExecuter.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/NcssExecuter.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/NcssExecuter.java
new file mode 100644
index 0000000..7f30439
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/NcssExecuter.java
@@ -0,0 +1,48 @@
+package com.adobe.ac.pmd.metrics.maven.utils;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.maven.reporting.MavenReportException;
+import org.dom4j.DocumentException;
+
+import com.adobe.ac.pmd.metrics.engine.FlexMetrics;
+
+public final class NcssExecuter
+{
+   private final double mxmlFactor;
+   private final File   outputDirectory;
+   private final File   sourceLocation;
+
+   public NcssExecuter( final File sourceLocationToBeSet,
+                        final File outputDirectoryToBeSet,
+                        final double mxmlFactorToBeSet )
+   {
+      sourceLocation = sourceLocationToBeSet;
+      outputDirectory = outputDirectoryToBeSet;
+      mxmlFactor = mxmlFactorToBeSet;
+   }
+
+   public void execute() throws MavenReportException,
+                        DocumentException,
+                        IOException
+   {
+      new FlexMetrics( sourceLocation, mxmlFactor ).execute( outputDirectory );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/NumericNodeComparator.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/NumericNodeComparator.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/NumericNodeComparator.java
new file mode 100644
index 0000000..6fdb639
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/java/com/adobe/ac/pmd/metrics/maven/utils/NumericNodeComparator.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.adobe.ac.pmd.metrics.maven.utils;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+import org.dom4j.Node;
+
+/**
+ * Comparator for numeric xml node tag.
+ *
+ * @author <a href="jeanlaurentATgmail.com">Jean-Laurent de Morlhon</a>
+ * @version $Id: NumericNodeComparator.java 3286 2007-02-08 20:18:51Z
+ *          jeanlaurent $
+ */
+public final class NumericNodeComparator implements Comparator< Node >, Serializable
+{
+    private static final long serialVersionUID = -2728762615963337680L;
+    /**
+     * the tag property used by this comparator
+     */
+    private final String      tagProperty;
+
+    /**
+     * The numeric node tag property to used by this comparator.
+     *
+     * @param property the tag property used by this comparator.
+     */
+    public NumericNodeComparator( final String property )
+    {
+        this.tagProperty = property;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int compare( final Node node1,
+                        final Node node2 )
+    {
+        return node2.numberValueOf( tagProperty ).intValue()
+                - node1.numberValueOf( tagProperty ).intValue();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/resources/flexMetrics.properties
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/resources/flexMetrics.properties b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/resources/flexMetrics.properties
new file mode 100644
index 0000000..c1558a4
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/main/resources/flexMetrics.properties
@@ -0,0 +1,94 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+report.ncss.name=FlexMetrics report
+report.ncss.description=
+report.ncss.header=
+report.javancss.name=FlexMetrics Report
+report.javancss.description=Code metric analysis.
+report.javancss.title=FlexMetrics Metric Results
+# titles and links
+report.javancss.main.title=FlexMetrics Metric Results
+report.javancss.main.text=The following document contains the results of a FlexMetrics metric analysis.
+report.javancss.module.title=Modules
+report.javancss.module.link=modules
+report.javancss.package.title=Packages
+report.javancss.package.link=package
+report.javancss.package.text=Packages sorted by NCSS.
+report.javancss.object.title=Objects
+report.javancss.object.link=object
+report.javancss.top=TOP
+report.javancss.averages=Averages.
+report.javancss.object.byncss=classes containing the most NCSS.
+report.javancss.object.byfunction=classes containing the most methods.
+report.javancss.function.title=Methods
+report.javancss.function.link=method
+report.javancss.function.byncss=Methods containing the most NCSS.
+report.javancss.explanation.title=Explanations
+report.javancss.explanation.link=explanation
+# headers
+report.javancss.header.module=Module
+report.javancss.header.classe=Classes
+report.javancss.header.function=Methods
+report.javancss.header.ncss=NCSS
+report.javancss.header.javadoc=ASdocs
+report.javancss.header.package=Package
+report.javancss.header.packages=Packages
+report.javancss.header.javadoc_line=ASdoc lines
+report.javancss.header.single_comment=Single lines comment
+report.javancss.header.multi_comment=Multi lines comment
+report.javancss.header.object=Object
+report.javancss.header.ccn=CCN
+# total
+report.javancss.header.totals=Totals
+report.javancss.header.ncsstotal=NCSS total
+report.javancss.header.functiontotal=Methods total
+report.javancss.header.classetotal=Classes total
+# average
+report.javancss.header.averages=Averages
+report.javancss.header.ncssaverage=NCSS average
+report.javancss.header.programncss=Program NCSS
+report.javancss.header.classeaverage=Classes average
+report.javancss.header.functionaverage=Methods average
+report.javancss.header.javadocaverage=ASdocs average
+report.javancss.header.ccnaverage=CCN average
+# explanation
+report.javancss.explanation.ncss.title=Non Commenting Source Statements (NCSS)
+report.javancss.explanation.ncss.paragraph1=Statements for FlexMetrics are not statements as specified in the ECMAScript 4 Language Specification but include all kinds of declarations too. Roughly spoken, NCSS is approximately equivalent to counting ';' and '{' characters in source files.
+report.javancss.explanation.ncss.paragraph2=Not counted are empty statements, empty blocks or semicolons after closing brackets. Of course, comments don't get counted too. Closing brackets also never get counted, the same applies to blocks in general.
+report.javancss.explanation.ncss.paragraph3=In some cases consecutive semicolons are illegal according to the JLS but FlexMetrics still tolerates them. Nevertheless they are never counted as two statements.
+report.javancss.explanation.ccn.title=Cyclomatic Complexity Number (CCN)
+report.javancss.explanation.ccn.paragraph1=CCN is also know as McCabe Metric. There exists a much hyped theory behind it based on graph theory, but it all comes down to simply counting 'if', 'for', 'while' statements etc. in a method. Whenever the control flow of a method splits, the "CCN counter" gets incremented by one.
+report.javancss.explanation.ccn.paragraph2=Each method has a minimum value of 1 per default. For each of the following Java keywords/statements this value gets incremented by one:
+report.javancss.explanation.ccn.paragraph3=Also if the control flow of a method returns abortively the CCNvalue will be incremented by one:
+report.javancss.explanation.ccn.paragraph4=An ordinary return at the end of method will not be counted.
+report.javancss.explanation.ccn.paragraph5=Note that 'else', 'default', and 'finally' don't increment the CCN value any further. On the other hand, a simple method with a 'switch' statement and a huge block of 'case' statements can have a surprisingly high CCN value (still it has the same value when converting a 'switch' block to an equivalent sequence of 'if' statements).
+
+#ncss explanation table
+report.javancss.explanation.ncss.table.examples=Examples
+report.javancss.explanation.ncss.table.comments=Comments
+report.javancss.explanation.ncss.table.package=Package declaration
+report.javancss.explanation.ncss.table.import=Import declaration
+report.javancss.explanation.ncss.table.class=Class declaration
+report.javancss.explanation.ncss.table.interface=Interface declaration
+report.javancss.explanation.ncss.table.field=Field declaration
+report.javancss.explanation.ncss.table.field.comment=No matter how many fields get actually declared through a comma separated list, and no matter if these fields get actually initialized, only one statement is counted. So \"int a, b, c = 5, d = 6;\" gets only +1 count, not four or even six (let me know if there is good reason to count it differently).
+report.javancss.explanation.ncss.table.method=Method declaration
+report.javancss.explanation.ncss.table.constructorD=Constructor declaration
+report.javancss.explanation.ncss.table.constructorI=Constructor invocation
+report.javancss.explanation.ncss.table.statement=Statement declaration
+report.javancss.explanation.ncss.table.statement.comment=expression, if, else, while, do, for, switch, break, continue, return, throw, synchronized, catch, finally
+report.javancss.explanation.ncss.table.label=Label declaration
+report.javancss.explanation.ncss.table.label.comment=normal, case, default

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/test/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsMojoTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/test/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsMojoTest.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/test/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsMojoTest.java
new file mode 100644
index 0000000..1af28df
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/test/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsMojoTest.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.adobe.ac.pmd.metrics.maven;
+
+import java.io.File;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+import org.codehaus.doxia.site.renderer.DefaultSiteRenderer;
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+
+public class FlexMetricsMojoTest extends FlexPmdTestBase
+{
+   private static final String TEMP_FILE_NAME = "javancss-raw-report.xml";
+
+   @Test
+   public void executeReport() throws MojoExecutionException,
+                              MojoFailureException
+   {
+      final MavenProjectStub project = new MavenProjectStub();
+      final File outputDirectoryToBeSet = new File( project.getBasedir().getAbsolutePath()
+            + "/target/pmd" );
+      final FlexMetricsReportMojo reportMojo = new FlexMetricsReportMojo( project,
+                                                                          getTestDirectory(),
+                                                                          outputDirectoryToBeSet );
+      final FlexMetricsMojo mojo = new FlexMetricsMojo( outputDirectoryToBeSet, getTestDirectory() );
+
+      outputDirectoryToBeSet.mkdirs();
+      reportMojo.setLineThreshold( 5 );
+      reportMojo.setSiteRenderer( new DefaultSiteRenderer() );
+      reportMojo.setXmlOutputDirectory( outputDirectoryToBeSet );
+      reportMojo.setTempFileName( TEMP_FILE_NAME );
+      reportMojo.execute();
+
+      mojo.setXmlOutputDirectory( outputDirectoryToBeSet );
+      mojo.setTempFileName( TEMP_FILE_NAME );
+      mojo.setCcnLimit( 50 );
+      mojo.setFailOnViolation( true );
+      mojo.setNcssLimit( 200 );
+
+      mojo.execute();
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/test/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsReportMojoTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/test/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsReportMojoTest.java b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/test/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsReportMojoTest.java
new file mode 100644
index 0000000..ef60647
--- /dev/null
+++ b/FlexPMD/flex-pmd-java/flex-pmd-metrics-maven-plugin/src/test/java/com/adobe/ac/pmd/metrics/maven/FlexMetricsReportMojoTest.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.adobe.ac.pmd.metrics.maven;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.util.Locale;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+import org.codehaus.doxia.site.renderer.DefaultSiteRenderer;
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+
+public class FlexMetricsReportMojoTest extends FlexPmdTestBase
+{
+   @Test
+   public void executeMultipleReport() throws MojoExecutionException
+   {
+      final MavenProjectStub project = new MavenProjectStub();
+      final File outputDirectoryToBeSet = new File( project.getBasedir().getAbsolutePath()
+            + "/target/pmd" );
+      final FlexMetricsReportMojo mojo = new FlexMetricsReportMojo( project, null, outputDirectoryToBeSet );
+
+      outputDirectoryToBeSet.mkdirs();
+      mojo.addReactorProject( new MavenProjectStub() );
+      mojo.addReactorProject( new MavenProjectStub() );
+      mojo.setLineThreshold( 5 );
+      mojo.setSiteRenderer( new DefaultSiteRenderer() );
+      mojo.setXmlOutputDirectory( outputDirectoryToBeSet );
+      mojo.setTempFileName( "javancss-raw-report.xml" );
+
+      assertNotNull( "",
+                     mojo.getName( Locale.ENGLISH ) );
+
+      mojo.execute();
+   }
+
+   @Test
+   public void executeSingleReport() throws MojoExecutionException
+   {
+      final File outputDirectoryToBeSet = new File( "target/pmd" );
+
+      outputDirectoryToBeSet.mkdirs();
+
+      final FlexMetricsReportMojo mojo = new FlexMetricsReportMojo( new MavenProjectStub(),
+                                                                    getTestDirectory(),
+                                                                    outputDirectoryToBeSet );
+
+      mojo.setLineThreshold( 5 );
+      mojo.setSiteRenderer( new DefaultSiteRenderer() );
+      mojo.setXmlOutputDirectory( outputDirectoryToBeSet );
+      mojo.setTempFileName( "javancss-raw-report.xml" );
+
+      assertNotNull( "",
+                     mojo.getName( Locale.ENGLISH ) );
+
+      mojo.execute();
+   }
+
+   @Test
+   public void executeSingleReportOnNonExistingFolder() throws MojoExecutionException
+   {
+      final File outputDirectoryToBeSet = new File( "target/pmd" );
+
+      outputDirectoryToBeSet.mkdirs();
+
+      final FlexMetricsReportMojo mojo = new FlexMetricsReportMojo( new MavenProjectStub(),
+                                                                    new File( "nonExisting" ),
+                                                                    outputDirectoryToBeSet );
+
+      mojo.setLineThreshold( 5 );
+      mojo.setSiteRenderer( new DefaultSiteRenderer() );
+      mojo.setXmlOutputDirectory( outputDirectoryToBeSet );
+      mojo.setTempFileName( "javancss-raw-report.xml" );
+
+      assertNotNull( "",
+                     mojo.getName( Locale.ENGLISH ) );
+
+      mojo.execute();
+   }
+}