Examples of IParserNode


Examples of com.adobe.ac.pmd.parser.IParserNode

   protected void findViolations( final IFunction function )
   {
      if ( function.isEventHandler()
            && !( function.getName().startsWith( prefix ) && function.getName().endsWith( suffix ) ) )
      {
         final IParserNode name = getNameFromFunctionDeclaration( function.getInternalNode() );

         addViolation( name,
                       name.getStringValue(),
                       prefix,
                       suffix );
      }
   }
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

                                       final FunctionType type )
   {
      super.visitFunction( ast,
                           type );

      final IParserNode paramList = ast.getChild( 2 );

      paramsNb = paramList.numChildren();

      if ( paramsNb > getThreshold() )
      {
         addViolation( paramList );
      }
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

   @Test
   public void testBuildAst2() throws IOException,
                              TokenException,
                              URISyntaxException
   {
      final IParserNode flexPmd62 = asp.buildAst( getClass().getResource( "/examples/FlexPMD62.as" )
                                                            .toURI()
                                                            .getPath() );

      assertEquals( "com.test.testy.ui.components",
                    flexPmd62.getChild( 0 ).getChild( 0 ).getStringValue() );

   }
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

   @Test
   @Ignore("This test requires test-data that was not donated to Apache")
   public void testCreate() throws PMDException
   {
      final IFlexFile file = getTestFiles().get( "bug.FlexPMD60.as" );
      final IParserNode ast = FileSetUtils.buildAst( file );
      final IClass classNode = NodeFactory.createPackage( ast ).getClassNode();
      final InternalFunctionMetrics classMetrics = InternalFunctionMetrics.create( new ProjectMetrics(),
                                                                                   "bug",
                                                                                   classNode );
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

   @Test
   @Ignore("This test requires test-data that was not donated to Apache")
   public void testComputeMultiLineComments() throws PMDException
   {
      final IFlexFile file = getTestFiles().get( "bug.FlexPMD60.as" );
      final IParserNode ast = FileSetUtils.buildAst( file );
      final IClass classNode = NodeFactory.createPackage( ast ).getClassNode();

      assertEquals( 6,
                    MetricUtils.computeMultiLineComments( classNode ) );
   }
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

    *
    * @throws TokenException
    */
   final IParserNode parseStatement() throws TokenException
   {
      IParserNode result;

      if ( tokIs( KeyWords.FOR ) )
      {
         result = parseFor();
      }
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

      return result;
   }

   private IParserNode parseConditionalExpression() throws TokenException
   {
      final IParserNode result = parseOrExpression();
      if ( tokIs( Operators.QUESTION_MARK ) )
      {
         final Node conditional = Node.create( NodeKind.CONDITIONAL,
                                               tok.getLine(),
                                               tok.getColumn(),
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

{
   @Test
   public void testBug157() throws PMDException
   {
      final IFlexFile file = getTestFiles().get( "bug.FlexPMD157.as" );
      final IParserNode ast = FileSetUtils.buildAst( file );
      final IClass classNode = NodeFactory.createPackage( ast ).getClassNode();
      final ClassMetrics classMetrics = ClassMetrics.create( "bug",
                                                             new File( file.getFilePath() ),
                                                             InternalFunctionMetrics.create( new ProjectMetrics(),
                                                                                             file.getFullyQualifiedName(),
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

   @Test
   public void testBug181() throws PMDException
   {
      final IFlexFile file = getTestFiles().get( "bug.FlexPMD181.as" );
      final IParserNode ast = FileSetUtils.buildAst( file );
      final IClass classNode = NodeFactory.createPackage( ast ).getClassNode();
      final ClassMetrics classMetrics = ClassMetrics.create( "bug",
                                                             new File( file.getFilePath() ),
                                                             InternalFunctionMetrics.create( new ProjectMetrics(),
                                                                                             file.getFullyQualifiedName(),
View Full Code Here

Examples of com.adobe.ac.pmd.parser.IParserNode

   @Test
   public void testBug232() throws PMDException
   {
      final IFlexFile file = getTestFiles().get( "bug.FlexPMD232.as" );
      final IParserNode ast = FileSetUtils.buildAst( file );
      final IClass classNode = NodeFactory.createPackage( ast ).getClassNode();
      final ClassMetrics classMetrics = ClassMetrics.create( "bug",
                                                             new File( file.getFilePath() ),
                                                             InternalFunctionMetrics.create( new ProjectMetrics(),
                                                                                             file.getFullyQualifiedName(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.