コード例 #1
0
 private void AddAnalyzerExpressionCOmplexity(ImmutableArray<DiagnosticAnalyzer>.Builder builder)
 {
     var analyzer = new ExpressionComplexity();
     if (!AnalyzerIds.Contains(analyzer.SupportedDiagnostics.Single().Id))
     {
         return;
     }
     analyzer.Maximum = int.Parse(
         Parameters[analyzer.SupportedDiagnostics.Single().Id].Single()["max"],
         NumberStyles.None, CultureInfo.InvariantCulture);
     builder.Add(analyzer);
 }
コード例 #2
0
 public void ExpressionComplexity()
 {
     var diagnostic = new ExpressionComplexity {Maximum = 3};
     Verifier.Verify(@"TestCases\ExpressionComplexity.cs", diagnostic);
 }