private void OnCompilationStartAction(CompilationStartAnalysisContext context, Configuration config)
        {
            var taintAnalyzer = new CSharpCodeEvaluation(CSharpSyntaxNodeHelper.Default, config, Extensions);

            context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, CSharp.SyntaxKind.MethodDeclaration);
            context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, CSharp.SyntaxKind.ConstructorDeclaration);
            context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, CSharp.SyntaxKind.DestructorDeclaration);
            context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, CSharp.SyntaxKind.PropertyDeclaration);
        }
Exemple #2
0
 public override void Initialize(AnalysisContext analysisContext)
 {
     analysisContext.RegisterCompilationStartAction(
         context =>
     {
         var taintAnalyzer = new CSharpCodeEvaluation(CSharpSyntaxNodeHelper.Default,
                                                      ConfigurationManager.Instance
                                                      .GetUpdatedProjectConfiguration(context.Options.AdditionalFiles));
         context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, CSharp.SyntaxKind.MethodDeclaration);
         context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, CSharp.SyntaxKind.ConstructorDeclaration);
         context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, CSharp.SyntaxKind.DestructorDeclaration);
         context.RegisterSyntaxNodeAction(taintAnalyzer.VisitMethods, CSharp.SyntaxKind.PropertyDeclaration);
     });
 }