flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [34/46] FlexPMD Donation from Adobe Systems Inc
Date Fri, 25 Apr 2014 06:18:33 GMT
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/main/java/com/adobe/ac/pmd/engines/FlexPmdXmlEngine.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/main/java/com/adobe/ac/pmd/engines/FlexPmdXmlEngine.java b/FlexPMD/flex-pmd-core/src/main/java/com/adobe/ac/pmd/engines/FlexPmdXmlEngine.java
new file mode 100644
index 0000000..4835993
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/main/java/com/adobe/ac/pmd/engines/FlexPmdXmlEngine.java
@@ -0,0 +1,171 @@
+/*
+ * 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.engines;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.logging.Logger;
+
+import net.sourceforge.pmd.PMDException;
+
+import com.adobe.ac.pmd.FlexPmdParameters;
+import com.adobe.ac.pmd.FlexPmdViolations;
+import com.adobe.ac.pmd.IFlexViolation;
+import com.adobe.ac.pmd.files.IFlexFile;
+
+public class FlexPmdXmlEngine extends AbstractFlexPmdEngine
+{
+   private static final Logger LOGGER = Logger.getLogger( FlexPmdXmlEngine.class.getName() );
+
+   public FlexPmdXmlEngine( final FlexPmdParameters parameters ) throws URISyntaxException,
+                                                                IOException
+   {
+      super( parameters );
+   }
+
+   @Override
+   protected final void writeReport( final FlexPmdViolations pmd ) throws PMDException
+   {
+      final File realOutputDirectory = getOutputDirectory();
+      final String filePath = realOutputDirectory.getAbsoluteFile()
+            + File.separator + FlexPMDFormat.XML.toString();
+
+      makeSureOutputDirectoryExists( realOutputDirectory );
+
+      Writer writter = null;
+      try
+      {
+         LOGGER.finest( "Start writting XML report" );
+         LOGGER.info( "Creating report in <"
+               + filePath + ">" );
+
+         writter = new OutputStreamWriter( new FileOutputStream( filePath ), "UTF-8" );
+         writeReportHeader( writter );
+         writeFileViolations( pmd,
+                              writter );
+         writeReportFooter( writter );
+         writter.close();
+      }
+      catch ( final IOException e )
+      {
+         throw new PMDException( "Error creating file "
+               + filePath, e );
+      }
+      finally
+      {
+         finalizeReport( writter );
+      }
+   }
+
+   private void finalizeReport( final Writer writter )
+   {
+      LOGGER.finest( "End writting XML report" );
+
+      if ( writter != null )
+      {
+         try
+         {
+            LOGGER.finest( "Closing the XML writter" );
+            writter.close();
+         }
+         catch ( final IOException e )
+         {
+            LOGGER.warning( Arrays.toString( e.getStackTrace() ) );
+         }
+         LOGGER.finest( "Closed the XML writter" );
+      }
+   }
+
+   private void formatFileFiolation( final Writer writter,
+                                     final IFlexFile sourceFile,
+                                     final Collection< IFlexViolation > violations,
+                                     final String sourceFilePath ) throws IOException
+   {
+      if ( !violations.isEmpty() )
+      {
+         if ( sourceFilePath.charAt( 2 ) == ':' )
+         {
+            writter.write( "   <file name=\""
+                  + sourceFilePath.substring( 1,
+                                              sourceFilePath.length() ) + "\">" + getNewLine() );
+         }
+         else
+         {
+            writter.write( "   <file name=\""
+                  + sourceFilePath + "\">" + getNewLine() );
+
+         }
+         for ( final IFlexViolation violation : violations )
+         {
+            writter.write( violation.toXmlString( sourceFile,
+                                                  violation.getRule().getRuleSetName() ) );
+         }
+         writter.write( "   </file>"
+               + getNewLine() );
+      }
+   }
+
+   private String getNewLine()
+   {
+      return System.getProperty( "line.separator" );
+   }
+
+   private void makeSureOutputDirectoryExists( final File realOutputDirectory )
+   {
+      if ( !realOutputDirectory.exists()
+            && !realOutputDirectory.mkdirs() )
+      {
+         LOGGER.severe( "Unable to create an output folder" );
+      }
+   }
+
+   private void writeFileViolations( final FlexPmdViolations pmd,
+                                     final Writer writter ) throws IOException
+   {
+      for ( final IFlexFile sourceFile : pmd.getViolations().keySet() )
+      {
+         final Collection< IFlexViolation > violations = pmd.getViolations().get( sourceFile );
+         final String sourceFilePath = sourceFile.getFilePath();
+
+         formatFileFiolation( writter,
+                              sourceFile,
+                              violations,
+                              sourceFilePath );
+      }
+   }
+
+   private void writeReportFooter( final Writer writter ) throws IOException
+   {
+      writter.write( "</pmd>"
+            + getNewLine() );
+   }
+
+   private void writeReportHeader( final Writer writter ) throws IOException
+   {
+      writter.write( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+            + getNewLine() );
+      writter.write( "<pmd version=\"4.2.1\" timestamp=\""
+            + new Date().toString() + "\">" + getNewLine() );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/main/java/com/adobe/ac/pmd/engines/PmdEngineUtils.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/main/java/com/adobe/ac/pmd/engines/PmdEngineUtils.java b/FlexPMD/flex-pmd-core/src/main/java/com/adobe/ac/pmd/engines/PmdEngineUtils.java
new file mode 100644
index 0000000..7c48a9e
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/main/java/com/adobe/ac/pmd/engines/PmdEngineUtils.java
@@ -0,0 +1,66 @@
+/*
+ * 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.engines;
+
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.Map.Entry;
+
+import com.adobe.ac.pmd.FlexPmdViolations;
+import com.adobe.ac.pmd.IFlexViolation;
+import com.adobe.ac.pmd.files.IFlexFile;
+import com.adobe.ac.pmd.rules.core.ViolationPriority;
+
+public final class PmdEngineUtils
+{
+   public static String findFirstViolationError( final FlexPmdViolations violations )
+   {
+      final StringBuffer buffer = new StringBuffer();
+      final String message = "An error violation has been found on the file {0} at "
+            + "line {1}, with the rule \"{2}\": {3}";
+      final MessageFormat form = new MessageFormat( message );
+
+      for ( final Entry< IFlexFile, List< IFlexViolation >> violatedFile : violations.getViolations()
+                                                                                     .entrySet() )
+      {
+         for ( final IFlexViolation violation : violatedFile.getValue() )
+         {
+            if ( violation.getRule().getPriority() == Integer.parseInt( ViolationPriority.HIGH.toString() ) )
+            {
+               final String[] formatArgument = computeArgumentFormat( violation );
+               buffer.append( form.format( formatArgument ) );
+               buffer.append( '\n' );
+            }
+         }
+      }
+      return buffer.toString();
+   }
+
+   private static String[] computeArgumentFormat( final IFlexViolation violation )
+   {
+      final String[] formatArgument = new String[]
+      { violation.getFilename(),
+                  String.valueOf( violation.getBeginLine() ),
+                  violation.getRule().getRuleClass(),
+                  violation.getRuleMessage() };
+      return formatArgument;
+   }
+
+   private PmdEngineUtils()
+   {
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AbstractEntireRulesetTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AbstractEntireRulesetTest.java b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AbstractEntireRulesetTest.java
new file mode 100644
index 0000000..9c5102f
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AbstractEntireRulesetTest.java
@@ -0,0 +1,87 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import net.sourceforge.pmd.PMDException;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.engines.FlexPmdXmlEngine;
+
+import junit.framework.TestCase;
+
+public abstract class AbstractEntireRulesetTest extends TestCase
+{
+
+   protected static final String OUTPUT_DIRECTORY_URL = "target/report/";
+
+   public AbstractEntireRulesetTest()
+   {
+      super();
+   }
+
+   protected abstract int getRulesNb();
+
+   protected abstract int getViolatedFilesNb();
+
+   protected abstract String getRuleSetPath();
+
+   public AbstractEntireRulesetTest( String name )
+   {
+      super( name );
+   }
+
+   @Test
+   public void testLoadRuleSet() throws URISyntaxException,
+                                   PMDException,
+                                   IOException
+   {
+      final File sourceDirectory = new File( getClass().getResource( "/test" ).toURI().getPath() );
+      final URL ruleSetUrl = getClass().getResource( getRuleSetPath() );
+   
+      assertNotNull( "RuleSet has not been found",
+                     ruleSetUrl );
+   
+      assertNotNull( "RuleSet has not been found",
+                     ruleSetUrl.toURI() );
+   
+      assertNotNull( "RuleSet has not been found",
+                     ruleSetUrl.toURI().getPath() );
+   
+      final File outputDirectory = new File( OUTPUT_DIRECTORY_URL );
+      final File ruleSetFile = new File( ruleSetUrl.toURI().getPath() );
+      final FlexPmdXmlEngine engine = new FlexPmdXmlEngine( new FlexPmdParameters( "",
+                                                                                   outputDirectory,
+                                                                                   ruleSetFile,
+                                                                                   sourceDirectory ) );
+      final FlexPmdViolations flexPmdViolations = new FlexPmdViolations();
+   
+      engine.executeReport( flexPmdViolations );
+   
+      assertEquals( "Number of rules found is not correct",
+                    getRulesNb(),
+                    engine.getRuleSet().size() );
+      assertEquals( getViolatedFilesNb(),
+                    flexPmdViolations.getViolations().size() );
+   }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AllInOneRulesetTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AllInOneRulesetTest.java b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AllInOneRulesetTest.java
new file mode 100644
index 0000000..62f1484
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AllInOneRulesetTest.java
@@ -0,0 +1,64 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+import net.sourceforge.pmd.PMDException;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.engines.FlexPmdXmlEngine;
+
+public class AllInOneRulesetTest extends AbstractEntireRulesetTest
+{
+   @Test
+   public void testLoadUncorrectRuleSet() throws URISyntaxException,
+                                         PMDException,
+                                         IOException
+   {
+      final File sourceDirectory = new File( getClass().getResource( "/test" ).toURI().getPath() );
+      final File outputDirectory = new File( OUTPUT_DIRECTORY_URL );
+
+      final FlexPmdXmlEngine engine = new FlexPmdXmlEngine( new FlexPmdParameters( "",
+                                                                                   outputDirectory,
+                                                                                   new File( "nonExist" ),
+                                                                                   sourceDirectory ) );
+
+      engine.executeReport( new FlexPmdViolations() );
+   }
+
+   @Override
+   protected String getRuleSetPath()
+   {
+      return "/allInOneRuleset.xml";
+   }
+
+   @Override
+   protected int getRulesNb()
+   {
+      return 43;
+   }
+
+   @Override
+   protected int getViolatedFilesNb()
+   {
+      return 50;
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AllInOneWithExclusionRulesetTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AllInOneWithExclusionRulesetTest.java b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AllInOneWithExclusionRulesetTest.java
new file mode 100644
index 0000000..10322f1
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/AllInOneWithExclusionRulesetTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+public class AllInOneWithExclusionRulesetTest extends AbstractEntireRulesetTest
+{
+   @Override
+   protected String getRuleSetPath()
+   {
+      return "/allInOneWithExclusionRuleset.xml";
+   }
+
+   @Override
+   protected int getRulesNb()
+   {
+      return 43;
+   }
+
+   @Override
+   protected int getViolatedFilesNb()
+   {
+      return 36;
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/FlexPmdParametersTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/FlexPmdParametersTest.java b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/FlexPmdParametersTest.java
new file mode 100644
index 0000000..94b1ff9
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/FlexPmdParametersTest.java
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+public class FlexPmdParametersTest
+{
+   @Test
+   public void testFlexPmdParametersStringBooleanBooleanFileFileFile()
+   {
+      final FlexPmdParameters parameters = new FlexPmdParameters( "", true, true, null, null, null );
+
+      Assert.assertTrue( parameters.isFailOnError() );
+      Assert.assertTrue( parameters.isFailOnRuleViolation() );
+   }
+
+   @Test
+   public void testFlexPmdParametersStringFileFileFileListOfFile()
+   {
+      final File file = new File( "" );
+      final ArrayList< File > sourceList = new ArrayList< File >();
+      final FlexPmdParameters parameters = new FlexPmdParameters( "", file, file, file, sourceList );
+
+      Assert.assertEquals( sourceList,
+                           parameters.getSourceList() );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/FlexPmdXmlEngineTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/FlexPmdXmlEngineTest.java b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/FlexPmdXmlEngineTest.java
new file mode 100644
index 0000000..d84641c
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/FlexPmdXmlEngineTest.java
@@ -0,0 +1,82 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.SchemaFactory;
+
+import org.xml.sax.SAXException;
+
+import com.adobe.ac.pmd.engines.AbstractFlexPmdEngine;
+import com.adobe.ac.pmd.engines.AbstractTestFlexPmdEngineTest;
+import com.adobe.ac.pmd.engines.FlexPMDFormat;
+import com.adobe.ac.pmd.engines.FlexPmdXmlEngine;
+
+public class FlexPmdXmlEngineTest extends AbstractTestFlexPmdEngineTest
+{
+   private static final String OUTPUT_DIRECTORY_URL = "target/report/";
+
+   public FlexPmdXmlEngineTest( final String name )
+   {
+      super( name );
+   }
+
+   @Override
+   protected AbstractFlexPmdEngine getFlexPmdEngine( final File sourceDirectory,
+                                                     final File outputDirectory,
+                                                     final String packageToExclude,
+                                                     final File ruleSet ) throws URISyntaxException,
+                                                                         IOException
+   {
+      return new FlexPmdXmlEngine( new FlexPmdParameters( packageToExclude,
+                                                          outputDirectory,
+                                                          ruleSet,
+                                                          sourceDirectory ) );
+   }
+
+   @Override
+   protected void onTestExecuteReportDone()
+   {
+      final File outXmlReport = new File( OUTPUT_DIRECTORY_URL
+            + FlexPMDFormat.XML.toString() );
+
+      final SchemaFactory factory = SchemaFactory.newInstance( "http://www.w3.org/2001/XMLSchema" );
+
+      final URL schemaResource = getClass().getResource( "/pmd.xsd" );
+
+      assertNotNull( "pmd.xsd is not loaded",
+                     schemaResource );
+
+      try
+      {
+         factory.newSchema( schemaResource ).newValidator().validate( new StreamSource( outXmlReport ) );
+      }
+      catch ( final SAXException e )
+      {
+         fail( e.getMessage() );
+      }
+      catch ( final IOException e )
+      {
+         fail( e.getMessage() );
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/LoadRulesetWithNonUTF8CharTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/LoadRulesetWithNonUTF8CharTest.java b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/LoadRulesetWithNonUTF8CharTest.java
new file mode 100644
index 0000000..69eb795
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/LoadRulesetWithNonUTF8CharTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+public class LoadRulesetWithNonUTF8CharTest extends AbstractEntireRulesetTest
+{
+   @Override
+   protected String getRuleSetPath()
+   {
+      return "/broken_pmd.xml";
+   }
+
+   @Override
+   protected int getRulesNb()
+   {
+      return 70;
+   }
+
+   @Override
+   protected int getViolatedFilesNb()
+   {
+      return 66;
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/engines/AbstractTestFlexPmdEngineTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/engines/AbstractTestFlexPmdEngineTest.java b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/engines/AbstractTestFlexPmdEngineTest.java
new file mode 100644
index 0000000..df495f5
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/engines/AbstractTestFlexPmdEngineTest.java
@@ -0,0 +1,73 @@
+/*
+ * 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.engines;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+import net.sourceforge.pmd.PMDException;
+
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import com.adobe.ac.pmd.FlexPmdViolations;
+
+public abstract class AbstractTestFlexPmdEngineTest extends TestCase
+{
+   private static final String OUTPUT_DIRECTORY_URL = "target/report/";
+
+   public AbstractTestFlexPmdEngineTest( final String name )
+   {
+      super( name );
+   }
+
+   @Test
+   public final void testExecuteReport() throws PMDException,
+                                        SAXException,
+                                        URISyntaxException,
+                                        IOException
+   {
+      final URL sourceDirectoryResource = getClass().getResource( "/test" );
+
+      assertNotNull( "Source directory is not found as a resource",
+                     sourceDirectoryResource );
+
+      assertNotNull( "Source directory is not found as a resource",
+                     sourceDirectoryResource.toURI() );
+
+      final File sourceDirectory = new File( sourceDirectoryResource.toURI().getPath() );
+      final File outputDirectory = new File( OUTPUT_DIRECTORY_URL );
+
+      getFlexPmdEngine( sourceDirectory,
+                        outputDirectory,
+                        "",
+                        null ).executeReport( new FlexPmdViolations() );
+
+      onTestExecuteReportDone();
+   }
+
+   protected abstract AbstractFlexPmdEngine getFlexPmdEngine( final File sourceDirectory,
+                                                              final File outputDirectory,
+                                                              final String packageToExclude,
+                                                              final File ruleSet ) throws URISyntaxException,
+                                                                                  IOException;
+
+   protected abstract void onTestExecuteReportDone();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/engines/PmdEngineUtilsTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/engines/PmdEngineUtilsTest.java b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/engines/PmdEngineUtilsTest.java
new file mode 100644
index 0000000..cc9a80a
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/java/com/adobe/ac/pmd/engines/PmdEngineUtilsTest.java
@@ -0,0 +1,103 @@
+/*
+ * 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.engines;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.FlexPmdViolations;
+import com.adobe.ac.pmd.IFlexViolation;
+import com.adobe.ac.pmd.files.IFlexFile;
+import com.adobe.ac.pmd.rules.core.AbstractFlexRule;
+import com.adobe.ac.pmd.rules.core.IFlexRule;
+import com.adobe.ac.pmd.rules.core.Violation;
+import com.adobe.ac.pmd.rules.core.ViolationPosition;
+import com.adobe.ac.pmd.rules.core.ViolationPriority;
+
+public class PmdEngineUtilsTest extends FlexPmdTestBase
+{
+   private class ErrorRule extends AbstractFlexRule implements IFlexRule
+   {
+      @Override
+      protected List< IFlexViolation > findViolationsInCurrentFile()
+      {
+         return new ArrayList< IFlexViolation >();
+      }
+
+      @Override
+      protected ViolationPriority getDefaultPriority()
+      {
+         return ViolationPriority.HIGH;
+      }
+
+      @Override
+      protected boolean isConcernedByTheCurrentFile()
+      {
+         return true;
+      }
+   }
+
+   private class WarningRule extends AbstractFlexRule
+   {
+      @Override
+      protected List< IFlexViolation > findViolationsInCurrentFile()
+      {
+         return new ArrayList< IFlexViolation >();
+      }
+
+      @Override
+      protected ViolationPriority getDefaultPriority()
+      {
+         return ViolationPriority.NORMAL;
+      }
+
+      @Override
+      protected boolean isConcernedByTheCurrentFile()
+      {
+         return true;
+      }
+   }
+
+   @Test
+   public void testFindFirstViolationError()
+   {
+      final FlexPmdViolations violations = new FlexPmdViolations();
+      final List< IFlexViolation > abstractRowDataViolations = new ArrayList< IFlexViolation >();
+
+      assertEquals( "",
+                    PmdEngineUtils.findFirstViolationError( violations ) );
+
+      final IFlexFile abstractRowDataFlexFile = getTestFiles().get( "AbstractRowData.as" );
+
+      abstractRowDataViolations.add( new Violation( new ViolationPosition( 0 ),
+                                                    new ErrorRule(),
+                                                    abstractRowDataFlexFile ) );
+      abstractRowDataViolations.add( new Violation( new ViolationPosition( 0 ),
+                                                    new WarningRule(),
+                                                    abstractRowDataFlexFile ) );
+      violations.getViolations().put( abstractRowDataFlexFile,
+                                      abstractRowDataViolations );
+      assertEquals( "An error violation has been found on the file AbstractRowData.as at line 0, with the rule"
+                          + " \"com.adobe.ac.pmd.engines.PmdEngineUtilsTest$ErrorRule\": \n",
+                    PmdEngineUtils.findFirstViolationError( violations ) );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/resources/allInOneRuleset.xml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/resources/allInOneRuleset.xml b/FlexPMD/flex-pmd-core/src/test/resources/allInOneRuleset.xml
new file mode 100644
index 0000000..aff76df
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/resources/allInOneRuleset.xml
@@ -0,0 +1,600 @@
+<!--
+
+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.
+
+-->
+<ruleset name="All Flex Rules"
+	xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+	xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
+	xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<description />
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.mxml.MoreThanTwoEntryPointsInMxmlRule"
+		message="There are more than 2 public variables in this MXML component">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.binding.TooLongBindingExpressionRule"
+		message="This binding expression is too long">
+		<description>A Binding expression is executed as soon as one of the bindable attributes changed. If a binding expression contains too many expression, there could be some performance issue.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>3</value>
+			</property>
+		</properties>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.mxml.TooLongScriptBlockRule"
+		message="This script block is too long">
+		<description />
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>50</value>
+			</property>
+		</properties>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.DynamicClassRule"
+		message="A class must not be dynamic">
+		<description>When using dynamic classes, you cannot control how the developer will use your classe. It makes refactoring really difficult.</description>
+		<priority>1</priority>
+		<example><![CDATA[
+dynamic public class DynamicObject // VIOLATION
+   {
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.event.EventMissingCloneFunctionRule"
+		message="The clone event must be overiden in a custom event">
+		<description>Why do you need to override clone? Well, the clone method creates a copy of your event (or object - whatever object has the clone event; this isn't limited to Event objects). The default clone method inherited by the Event class or whatever class your custom class extends, will return an event object of the type of that class, not your custom event subclass. In the situations where a clone is needed, it is needed to be of the same type of your class, not the class it extends.</description>
+		<priority>1</priority>
+		<example><![CDATA[
+public class FirstCustomEvent   // VIOLATION - clone method is missing
+   {
+      public var lala : String;
+      
+      public function FirstCustomEvent()
+      {         
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.event.PublicVariableInCustomEventRule"
+		message="No public variables should be inside a custom event">
+		<description>In order to improve encapsulation in your custom event, it is better not to have public variable in your event. Prefer having read-only attributes, set by the event constructor.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class FirstCustomEvent   
+   {
+      public var lala : String; // VIOLATION
+      
+      public function FirstCustomEvent()
+      {         
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.style.ConstructorNonEmptyReturnTypeRule"
+		message="A constructor should not have a return type">
+		<description>Even if this is syntaxically correct, there should not be a return type for a constructor.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class VoidConstructor   
+   {
+      public function VoidConstructor() : void
+      {         
+      }      
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.switchrules.SwitchStatementsShouldHaveDefaultRule"
+		message="A switch statement does not contain a default statement">
+		<description>Switch statements should have a default label in order to detect corner cases.</description>
+		<priority>1</priority>
+		<example><![CDATA[
+public class Foo 
+   {
+      public funciton bar() : void 
+      {
+         var  x : int = 2;
+         switch (x) 
+         {
+            case 2: var j : int = 8;
+         }
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.forbiddentypes.UseObjectTypeRule"
+		message="Do not use Object class.">
+		<description>It is a bad practice to use the dynamic class Object. Prefer using strongly typed object, or marker interface in order to avoid silent compilation errors while refactoring</description>
+		<priority>1</priority>
+		<example><![CDATA[
+public class Foo
+   {
+      public var bar : Object; // VIOLATION      
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.switchrules.NestedSwitchRule"
+		message="Switch must not be nested.">
+		<description>As a general practice, switch statement should not be used. Prefer using inheritance. It is even harder to read when siwtch statements are nested.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public function foo( a : Number, b : Number ) : void
+      {
+          switch( a )
+          {
+             case 1:
+                break;
+             case 2:                   
+                switch ( b ) 
+                {
+                  case 3 :
+                     break;
+                  case 4 :
+                     break;
+                }
+                break;                     
+          }
+      }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.maintanability.ArrayFieldWithNoArrayElementTypeRule"
+		message="ArrayElementType metadata is not specified for an array-type field">
+		<description />
+		<priority>3</priority>
+		<example><![CDATA[
+public class ArrayVO {
+      public var items:Array; //VIOLATION
+
+      [ArrayElementType("model.vo.MenuItemVO")]
+      public var menuItems : Array;
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.maintanability.NonStaticConstantFieldRule" message="A constant field should be static">
+		<description />
+		<priority>1</priority>
+		<example><![CDATA[
+public class MyObject {
+      public static const MY_STATIC_CONSTANT : String = "myStaticConstant";
+      public const MY_NON_STATIC_CONSTANT : String = "myStaticConstant"; // VIOLATION
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.unused.UnusedParameterRule" message="You should use all the parameters of a function">
+		<description />
+		<priority>1</priority>
+		<example><![CDATA[
+public function foo( param1 : Number, param2 : Number, param3 : Number, param4 : Number, param5 : Number ) : void // 4 violations
+      {
+         var i : int = param1;
+      }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.unused.UnusedLocalVariableRule"
+		message="You should delete an unused variable">
+		<description />
+		<priority>3</priority>
+		<example><![CDATA[
+public function foo() : void
+      {
+         var i : int = 0;// 1 violation
+      }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.unused.UnusedPrivateMethodRule"
+		message="This private method does not seem to be used">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.switchrules.TooFewBrancheInSwitchStatementRule"
+		message="There are too few branches in this swicth statement">
+		<description>Switch statements are designed for complex branches, and allow branches to share treatement. Using a switch for only 2 branches is ill advised, as switches are not as easy to understand as if. In this case, it's most likely is a good idea to use a if statement</description>
+		<priority>5</priority>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.style.BadFormatLoggerRule"
+		message="The loger is not correctly formatted">
+		<description />
+		<priority>5</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.performance.AvoidInstanciationInLoopRule"
+		message="Instanciating a variable in a loop can be expensive">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.architecture.ViewComponentReferencedInModelRule"
+		message="A view component should not be referenced in a model class">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.forbiddentypes.UseGenericTypeRule"
+		message="Use strongly typed objects instead of *">
+		<description />
+		<priority>1</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.event.DispatchHardCodedEventNameRule"
+		message="DispatchEvent function must dispatch constant strings">
+		<description>You should not dispatch a plain string. If you rename this string, you need to replace the string listener as well. Use constants instead</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function bar() : void
+      {
+         dispatch( new Event( "myHardCodedEvent" ) ); // VIOLATION
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.event.ListenForHardCodedEventNameRule"
+		message="addEventListener must not contain hard coded strings.">
+		<description>You should not listen for a plain string. If you rename this string, you need to replace the string listener as well. Use constants instead</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function bar() : void
+      {
+         addEventListener( "myHardCodedEvent", handleMyHardCodedEvent ); // VIOLATION
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.AlertShowRule"
+		message="Do not call Alert.show directly.">
+		<description>You should not Alert.show() directly. If an error occured in the system, you should probably use an ErrorManager to have a consistent way to manage those errors.</description>
+		<priority>1</priority>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.empty.EmptyIfStmtRule"
+		message="No statements in this if statement">
+		<description>Empty If Statement finds instances where a condition is checked but nothing is done about it.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function bar( x : int ) : void
+      {
+         if ( x == 0 ) 
+         {
+            // VIOLATION
+         }
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.ExcessiveImportRule"
+		message="A high number of imports can indicate a high degree of coupling within an object.">
+		<description>A high number of imports can indicate a high degree of coupling within an object. Rule counts the number of unique imports and reports a violation if the count is above the user defined threshold.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>15</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+import blah.blah.Baz;
+   import blah.blah.Bif;
+   // 18 others from the same package elided
+   public class Foo 
+   {
+      public function doWork() : void 
+      {
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.binding.BindingUtilsRule"
+		message="If you need to use BindingUtils, you should probably consider refactoring using events">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.style.OverLongLineRule"
+		message="Too long line ({0} maximum)">
+		<description />
+		<priority>5</priority>
+		<properties>
+			<property name="maximum">
+				<value>120</value>
+			</property>
+		</properties>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.style.ImportFromSamePackageRule"
+		message="Imports from the same package are not necessary">
+		<description />
+		<priority>1</priority>
+		<example><![CDATA[
+package com.adobe.ac
+{
+   import com.adobe.ac.MyModel; // VIOLATION HERE
+
+   public class BigModel   
+   {
+      public var model : MyModel = null;
+   }
+}
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.naming.IncorrectClassCase"
+		message="A class name must start by a majuscule character">
+		<description />
+		<priority>3</priority>
+		<example><![CDATA[
+public class foo
+   {
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.cairngorm.BindableModelLocatorRule"
+		message="A modelLocator must not be Bindable at a class level">
+		<description>A bindable ModelLocator could leads to performance issues due to bindings</description>
+		<priority>1</priority>
+		<example><![CDATA[
+[Bindable]
+   public class BindableModelLocator // VIOLATION 
+   {      
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.cairngorm.ReferenceModelLocatorOutsideTheMainApplicationRule"
+		message="The ModelLocator should be only accessible from the main application file">
+		<description>The ModelLocator should be only accessible from the main application file. Then sub-models should be injected to the nested views.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+package business
+{
+   import model.MyModelLocator; // VIOLATION
+   
+   public class MyBusinessClass 
+   } 
+}
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.cairngorm.FatControllerRule"
+		message="A FrontController must nor add all its commands within the Controller constructor.">
+		<description>Try split them into methods where you add commands depending on their fonctional area.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+package control
+{
+   import control.GetItems1Command;
+   import control.GetItems1Event;
+   import control.GetItems2Command;
+   import control.GetItems2Event;
+   // A lot of other imports
+   
+   public class MyFrontController // VIOLATION
+   {
+      public function MyFrontController()
+      {
+         addCommand( 
+            GetItems1Event.EVENT_NAME,
+            GetItems1Command );
+
+         addCommand( 
+            GetItems2Event.EVENT_NAME,
+            GetItems2Command );
+
+         // A lot of other addCommand
+      }
+   } 
+}
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.cairngorm.BadCairngormEventNameFormatRule"
+		message="A Cairngorm event name should contain the function area name before the actual event name">
+		<description>You would have something like 'productManagement.getProducts' as an event name.</description>
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.sizing.TooManyFunctionRule" message="Too many methods detected">
+		<description>A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>10</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function doWork() : void {}
+      public function doMoreWork() : void {}
+      public function doWorkAgain() : void {}
+      // [... more more public methods ...]
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.sizing.TooLongFunctionRule" message="This function is far long">
+		<description>Violations of this rule usually indicate that the method is doing too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>25</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function doSomething() : void
+      {
+         System.out.println("Hello world!");
+         System.out.println("Hello world!");
+         // 98 copies omitted for brevity.
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.sizing.TooLongSwitchCaseRule"
+		message="Long switch case detected">
+		<description>A switch case statement should be either empty, or contain a break, or call another method.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class Bar   
+   {
+      public function foo() : void
+      {
+          var i : int = 4;
+          
+          switch( i )
+          {
+             case 1:
+                handleFirstCase();
+                break;
+             case 2: // VIOLATION
+                googleResquest.url = "";
+                handleSecondCaseFirstPart();
+                handleSecondCaseSecondPart();
+                break;
+          }
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.sizing.TooManyParametersRule"
+		message="Long parameter list detected">
+		<description>Long parameter lists can indicate that a new object should be created to wrap the numerous parameters.  Basically, try to group the parameters together.</description>
+		<priority>1</priority>
+		<properties>
+			<property name="maximum">
+				<value>4</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function addData( p0 : int, p1 : int, p2 : int, p3 : int, p4 : int, p5 : int,
+                                             p6 : int, p7 : int, p8 : int, p9 : int, p10 : int ) : void 
+      {
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.sizing.TooManyPublicRule"
+		message="Too much public fields or functions detected">
+		<description>A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>10</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Foo 
+   {
+      public var value : String;
+      public var something : Bar;
+      public var variable : Variable;
+
+      // [... more more public attributes ...]
+
+      public function doWork() : void {}
+      public function doMoreWork() : void {}
+      public function doWorkAgain() : void {}
+
+      // [... more more public methods ...]
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.sizing.TooManyFieldsRule"
+		message="Too many field detected">
+		<description>Classes that have too many fields could be redesigned to have fewer fields, possibly  through some nested object grouping of some of the information.  For example, a class with  city/state/zip fields could instead have one Address field.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>5</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Person 
+   {
+      private var one : String;
+      private var two : int;
+      private var three : int;
+
+      [... many more public fields ...]
+
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.naming.TooShortVariableRule"
+		message="This variable name is too short">
+		<description>Detects when a field, local, or parameter has a very short name.</description>
+		<priority>5</priority>
+		<example><![CDATA[
+public class Something 
+   {
+      private var q : int = 15; // VIOLATION - Field
+	
+      public function foo( as : String ) : void // VIOLATION - Formal 
+      {
+         var r : int = 20 + q; // VIOLATION - Local
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.naming.PackageCaseRule"
+		message="A package name should be lower case">
+		<description>Detects when a package definition contains upper case characters.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+
+   package com.MyCompany  // VIOLATION <- should be lower case name
+   {
+      public class SomeClass 
+      {
+      }
+   }
+         
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.css.StyleBlockInMxmlRule"
+		message="The style block is embed in the MXML file">
+		<description>It is not a good practice to embed style blocks inside the MXML component. Prefer using external css files.</description>
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.performance.DynamicFiltersUsedInPopup"
+		message="A popup should use dynamic filters">
+		<description>Prefer using embed filters in assets</description>
+		<priority>3</priority>
+	</rule>
+</ruleset>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-core/src/test/resources/allInOneWithExclusionRuleset.xml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-core/src/test/resources/allInOneWithExclusionRuleset.xml b/FlexPMD/flex-pmd-core/src/test/resources/allInOneWithExclusionRuleset.xml
new file mode 100644
index 0000000..ca22972
--- /dev/null
+++ b/FlexPMD/flex-pmd-core/src/test/resources/allInOneWithExclusionRuleset.xml
@@ -0,0 +1,601 @@
+<!--
+
+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.
+
+-->
+<ruleset name="All Flex Rules Without AsDocs folder"
+	xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+	xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
+	xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<description />
+	<exclude-pattern>.*/com/.*</exclude-pattern>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.mxml.MoreThanTwoEntryPointsInMxmlRule"
+		message="There are more than 2 public variables in this MXML component">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.binding.TooLongBindingExpressionRule"
+		message="This binding expression is too long">
+		<description>A Binding expression is executed as soon as one of the bindable attributes changed. If a binding expression contains too many expression, there could be some performance issue.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>3</value>
+			</property>
+		</properties>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.mxml.TooLongScriptBlockRule"
+		message="This script block is too long">
+		<description />
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>50</value>
+			</property>
+		</properties>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.DynamicClassRule"
+		message="A class must not be dynamic">
+		<description>When using dynamic classes, you cannot control how the developer will use your classe. It makes refactoring really difficult.</description>
+		<priority>1</priority>
+		<example><![CDATA[
+dynamic public class DynamicObject // VIOLATION
+   {
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.event.EventMissingCloneFunctionRule"
+		message="The clone event must be overiden in a custom event">
+		<description>Why do you need to override clone? Well, the clone method creates a copy of your event (or object - whatever object has the clone event; this isn't limited to Event objects). The default clone method inherited by the Event class or whatever class your custom class extends, will return an event object of the type of that class, not your custom event subclass. In the situations where a clone is needed, it is needed to be of the same type of your class, not the class it extends.</description>
+		<priority>1</priority>
+		<example><![CDATA[
+public class FirstCustomEvent   // VIOLATION - clone method is missing
+   {
+      public var lala : String;
+      
+      public function FirstCustomEvent()
+      {         
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.event.PublicVariableInCustomEventRule"
+		message="No public variables should be inside a custom event">
+		<description>In order to improve encapsulation in your custom event, it is better not to have public variable in your event. Prefer having read-only attributes, set by the event constructor.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class FirstCustomEvent   
+   {
+      public var lala : String; // VIOLATION
+      
+      public function FirstCustomEvent()
+      {         
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.style.ConstructorNonEmptyReturnTypeRule"
+		message="A constructor should not have a return type">
+		<description>Even if this is syntaxically correct, there should not be a return type for a constructor.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class VoidConstructor   
+   {
+      public function VoidConstructor() : void
+      {         
+      }      
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.switchrules.SwitchStatementsShouldHaveDefaultRule"
+		message="A switch statement does not contain a default statement">
+		<description>Switch statements should have a default label in order to detect corner cases.</description>
+		<priority>1</priority>
+		<example><![CDATA[
+public class Foo 
+   {
+      public funciton bar() : void 
+      {
+         var  x : int = 2;
+         switch (x) 
+         {
+            case 2: var j : int = 8;
+         }
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.forbiddentypes.UseObjectTypeRule"
+		message="Do not use Object class.">
+		<description>It is a bad practice to use the dynamic class Object. Prefer using strongly typed object, or marker interface in order to avoid silent compilation errors while refactoring</description>
+		<priority>1</priority>
+		<example><![CDATA[
+public class Foo
+   {
+      public var bar : Object; // VIOLATION      
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.switchrules.NestedSwitchRule"
+		message="Switch must not be nested.">
+		<description>As a general practice, switch statement should not be used. Prefer using inheritance. It is even harder to read when siwtch statements are nested.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public function foo( a : Number, b : Number ) : void
+      {
+          switch( a )
+          {
+             case 1:
+                break;
+             case 2:                   
+                switch ( b ) 
+                {
+                  case 3 :
+                     break;
+                  case 4 :
+                     break;
+                }
+                break;                     
+          }
+      }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.maintanability.ArrayFieldWithNoArrayElementTypeRule"
+		message="ArrayElementType metadata is not specified for an array-type field">
+		<description />
+		<priority>3</priority>
+		<example><![CDATA[
+public class ArrayVO {
+      public var items:Array; //VIOLATION
+
+      [ArrayElementType("model.vo.MenuItemVO")]
+      public var menuItems : Array;
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.maintanability.NonStaticConstantFieldRule" message="A constant field should be static">
+		<description />
+		<priority>1</priority>
+		<example><![CDATA[
+public class MyObject {
+      public static const MY_STATIC_CONSTANT : String = "myStaticConstant";
+      public const MY_NON_STATIC_CONSTANT : String = "myStaticConstant"; // VIOLATION
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.unused.UnusedParameterRule" message="You should use all the parameters of a function">
+		<description />
+		<priority>1</priority>
+		<example><![CDATA[
+public function foo( param1 : Number, param2 : Number, param3 : Number, param4 : Number, param5 : Number ) : void // 4 violations
+      {
+         var i : int = param1;
+      }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.unused.UnusedLocalVariableRule"
+		message="You should delete an unused variable">
+		<description />
+		<priority>3</priority>
+		<example><![CDATA[
+public function foo() : void
+      {
+         var i : int = 0;// 1 violation
+      }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.unused.UnusedPrivateMethodRule"
+		message="This private method does not seem to be used">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.switchrules.TooFewBrancheInSwitchStatementRule"
+		message="There are too few branches in this swicth statement">
+		<description>Switch statements are designed for complex branches, and allow branches to share treatement. Using a switch for only 2 branches is ill advised, as switches are not as easy to understand as if. In this case, it's most likely is a good idea to use a if statement</description>
+		<priority>5</priority>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.style.BadFormatLoggerRule"
+		message="The loger is not correctly formatted">
+		<description />
+		<priority>5</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.performance.AvoidInstanciationInLoopRule"
+		message="Instanciating a variable in a loop can be expensive">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.architecture.ViewComponentReferencedInModelRule"
+		message="A view component should not be referenced in a model class">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.forbiddentypes.UseGenericTypeRule"
+		message="Use strongly typed objects instead of *">
+		<description />
+		<priority>1</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.event.DispatchHardCodedEventNameRule"
+		message="DispatchEvent function must dispatch constant strings">
+		<description>You should not dispatch a plain string. If you rename this string, you need to replace the string listener as well. Use constants instead</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function bar() : void
+      {
+         dispatch( new Event( "myHardCodedEvent" ) ); // VIOLATION
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.event.ListenForHardCodedEventNameRule"
+		message="addEventListener must not contain hard coded strings.">
+		<description>You should not listen for a plain string. If you rename this string, you need to replace the string listener as well. Use constants instead</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function bar() : void
+      {
+         addEventListener( "myHardCodedEvent", handleMyHardCodedEvent ); // VIOLATION
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.AlertShowRule"
+		message="Do not call Alert.show directly.">
+		<description>You should not Alert.show() directly. If an error occured in the system, you should probably use an ErrorManager to have a consistent way to manage those errors.</description>
+		<priority>1</priority>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.empty.EmptyIfStmtRule"
+		message="No statements in this if statement">
+		<description>Empty If Statement finds instances where a condition is checked but nothing is done about it.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function bar( x : int ) : void
+      {
+         if ( x == 0 ) 
+         {
+            // VIOLATION
+         }
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.maintanability.ExcessiveImportRule"
+		message="A high number of imports can indicate a high degree of coupling within an object.">
+		<description>A high number of imports can indicate a high degree of coupling within an object. Rule counts the number of unique imports and reports a violation if the count is above the user defined threshold.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>15</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+import blah.blah.Baz;
+   import blah.blah.Bif;
+   // 18 others from the same package elided
+   public class Foo 
+   {
+      public function doWork() : void 
+      {
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.binding.BindingUtilsRule"
+		message="If you need to use BindingUtils, you should probably consider refactoring using events">
+		<description />
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.style.OverLongLineRule"
+		message="Too long line ({0} maximum)">
+		<description />
+		<priority>5</priority>
+		<properties>
+			<property name="maximum">
+				<value>120</value>
+			</property>
+		</properties>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.style.ImportFromSamePackageRule"
+		message="Imports from the same package are not necessary">
+		<description />
+		<priority>1</priority>
+		<example><![CDATA[
+package com.adobe.ac
+{
+   import com.adobe.ac.MyModel; // VIOLATION HERE
+
+   public class BigModel   
+   {
+      public var model : MyModel = null;
+   }
+}
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.naming.IncorrectClassCase"
+		message="A class name must start by a majuscule character">
+		<description />
+		<priority>3</priority>
+		<example><![CDATA[
+public class foo
+   {
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.cairngorm.BindableModelLocatorRule"
+		message="A modelLocator must not be Bindable at a class level">
+		<description>A bindable ModelLocator could leads to performance issues due to bindings</description>
+		<priority>1</priority>
+		<example><![CDATA[
+[Bindable]
+   public class BindableModelLocator // VIOLATION 
+   {      
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.cairngorm.ReferenceModelLocatorOutsideTheMainApplicationRule"
+		message="The ModelLocator should be only accessible from the main application file">
+		<description>The ModelLocator should be only accessible from the main application file. Then sub-models should be injected to the nested views.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+package business
+{
+   import model.MyModelLocator; // VIOLATION
+   
+   public class MyBusinessClass 
+   } 
+}
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.cairngorm.FatControllerRule"
+		message="A FrontController must nor add all its commands within the Controller constructor.">
+		<description>Try split them into methods where you add commands depending on their fonctional area.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+package control
+{
+   import control.GetItems1Command;
+   import control.GetItems1Event;
+   import control.GetItems2Command;
+   import control.GetItems2Event;
+   // A lot of other imports
+   
+   public class MyFrontController // VIOLATION
+   {
+      public function MyFrontController()
+      {
+         addCommand( 
+            GetItems1Event.EVENT_NAME,
+            GetItems1Command );
+
+         addCommand( 
+            GetItems2Event.EVENT_NAME,
+            GetItems2Command );
+
+         // A lot of other addCommand
+      }
+   } 
+}
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.cairngorm.BadCairngormEventNameFormatRule"
+		message="A Cairngorm event name should contain the function area name before the actual event name">
+		<description>You would have something like 'productManagement.getProducts' as an event name.</description>
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.sizing.TooManyFunctionRule" message="Too many methods detected">
+		<description>A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>10</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function doWork() : void {}
+      public function doMoreWork() : void {}
+      public function doWorkAgain() : void {}
+      // [... more more public methods ...]
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.sizing.TooLongFunctionRule" message="This function is far long">
+		<description>Violations of this rule usually indicate that the method is doing too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>25</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function doSomething() : void
+      {
+         System.out.println("Hello world!");
+         System.out.println("Hello world!");
+         // 98 copies omitted for brevity.
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.sizing.TooLongSwitchCaseRule"
+		message="Long switch case detected">
+		<description>A switch case statement should be either empty, or contain a break, or call another method.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+public class Bar   
+   {
+      public function foo() : void
+      {
+          var i : int = 4;
+          
+          switch( i )
+          {
+             case 1:
+                handleFirstCase();
+                break;
+             case 2: // VIOLATION
+                googleResquest.url = "";
+                handleSecondCaseFirstPart();
+                handleSecondCaseSecondPart();
+                break;
+          }
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.sizing.TooManyParametersRule"
+		message="Long parameter list detected">
+		<description>Long parameter lists can indicate that a new object should be created to wrap the numerous parameters.  Basically, try to group the parameters together.</description>
+		<priority>1</priority>
+		<properties>
+			<property name="maximum">
+				<value>4</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Foo 
+   {
+      public function addData( p0 : int, p1 : int, p2 : int, p3 : int, p4 : int, p5 : int,
+                                             p6 : int, p7 : int, p8 : int, p9 : int, p10 : int ) : void 
+      {
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.sizing.TooManyPublicRule"
+		message="Too much public fields or functions detected">
+		<description>A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>10</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Foo 
+   {
+      public var value : String;
+      public var something : Bar;
+      public var variable : Variable;
+
+      // [... more more public attributes ...]
+
+      public function doWork() : void {}
+      public function doMoreWork() : void {}
+      public function doWorkAgain() : void {}
+
+      // [... more more public methods ...]
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.sizing.TooManyFieldsRule"
+		message="Too many field detected">
+		<description>Classes that have too many fields could be redesigned to have fewer fields, possibly  through some nested object grouping of some of the information.  For example, a class with  city/state/zip fields could instead have one Address field.</description>
+		<priority>3</priority>
+		<properties>
+			<property name="maximum">
+				<value>5</value>
+			</property>
+		</properties>
+		<example><![CDATA[
+public class Person 
+   {
+      private var one : String;
+      private var two : int;
+      private var three : int;
+
+      [... many more public fields ...]
+
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.naming.TooShortVariableRule"
+		message="This variable name is too short">
+		<description>Detects when a field, local, or parameter has a very short name.</description>
+		<priority>5</priority>
+		<example><![CDATA[
+public class Something 
+   {
+      private var q : int = 15; // VIOLATION - Field
+	
+      public function foo( as : String ) : void // VIOLATION - Formal 
+      {
+         var r : int = 20 + q; // VIOLATION - Local
+      }
+   }
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.naming.PackageCaseRule"
+		message="A package name should be lower case">
+		<description>Detects when a package definition contains upper case characters.</description>
+		<priority>3</priority>
+		<example><![CDATA[
+
+   package com.MyCompany  // VIOLATION <- should be lower case name
+   {
+      public class SomeClass 
+      {
+      }
+   }
+         
+           ]]></example>
+	</rule>
+	<rule since="0.1" class="com.adobe.ac.pmd.rules.css.StyleBlockInMxmlRule"
+		message="The style block is embed in the MXML file">
+		<description>It is not a good practice to embed style blocks inside the MXML component. Prefer using external css files.</description>
+		<priority>3</priority>
+	</rule>
+	<rule since="0.1"
+		class="com.adobe.ac.pmd.rules.performance.DynamicFiltersUsedInPopup"
+		message="A popup should use dynamic filters">
+		<description>Prefer using embed filters in assets</description>
+		<priority>3</priority>
+	</rule>
+</ruleset>
\ No newline at end of file


Mime
View raw message