Examples of IParserNode


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

   @Test
   public void testBug233() throws PMDException
   {
      final IFlexFile file = getTestFiles().get( "bug.Duane.mxml" );
      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 testToXmlString() throws PMDException
   {
      final IFlexFile file = getTestFiles().get( "RadonDataGrid.as" );
      final IParserNode ast = FileSetUtils.buildAst( file );
      final IClass classNode = NodeFactory.createPackage( ast ).getClassNode();
      final ClassMetrics classMetrics = ClassMetrics.create( "com.adobe.ac",
                                                             new File( file.getFilePath() ),
                                                             InternalFunctionMetrics.create( new ProjectMetrics(),
                                                                                             file.getFullyQualifiedName(),
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 testToXmlStringWithMultiLineComments() throws PMDException
   {
      final IFlexFile file = getTestFiles().get( "bug.FlexPMD60.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

   /**
    * @return
    */
   public IParserNode getLastChild()
   {
      final IParserNode lastChild = getChild( numChildren() - 1 );

      return lastChild != null
            && lastChild.numChildren() > 0 ? lastChild.getLastChild()
                                          : lastChild;
   }
View Full Code Here

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

    */
   @Override
   protected void findViolationsFromFunctionMetaData( final IFunction function )
   {
      final List< IMetaData > interceptors = ParsleyMetaData.MESSAGE_INTERCEPTOR.getMetaDataList( function );
      final IParserNode name = getNameFromFunctionDeclaration( function.getInternalNode() );

      if ( !interceptors.isEmpty() )
      {

         if ( !function.isPublic() )
         {
            addViolation( name,
                          name,
                          name.getStringValue(),
                          "It is not public" );
         }
         if ( function.getParameters().size() == 1 )
         {
            if ( !hasMessageProcessorParameter( function ) )
            {
               addViolation( name,
                             name,
                             name.getStringValue(),
                             "The argument type should be MessageProcessor" );
            }
         }
         else
         {
            addViolation( name,
                          name,
                          name.getStringValue(),
                          "Its argument number is not 1" );
         }
      }
   }
View Full Code Here

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

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

      final IParserNode block = functionNode.getChild( functionNode.numChildren() - 1 );

      if ( block != null
            && block.numChildren() != 0 )
      {
         functionLength = FunctionUtils.computeFunctionLength( getCurrentFile(),
                                                               block );
         if ( functionLength > getThreshold() )
         {
View Full Code Here

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

      super.visitClass( classNode );

      for ( final String variableName : getVariablesUnused().keySet() )
      {
         final IParserNode variable = getVariablesUnused().get( variableName );

         addViolation( variable,
                       variable,
                       variableName );
      }
View Full Code Here

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

         if ( !functionIsEventHandler( functionAst ) )
         {
            for ( final String variableName : getVariablesUnused().keySet() )
            {
               final IParserNode variable = getVariablesUnused().get( variableName );

               addViolation( variable,
                             variable,
                             variableName );
            }
View Full Code Here

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

      return false;
   }

   private boolean isParameterAnEvent( final IParserNode parameterNode )
   {
      final IParserNode parameterType = getTypeFromFieldDeclaration( parameterNode );

      return parameterType != null
            && parameterType.getStringValue() != null && parameterType.getStringValue().contains( "Event" );
   }
View Full Code Here

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

      super.visitFunction( ast,
                           type );
      for ( final String variableName : getVariablesUnused().keySet() )
      {
         final IParserNode variable = getVariablesUnused().get( variableName );

         addViolation( variable,
                       variable,
                       variableName );
      }
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.