Exemplo n.º 1
0
 private void AddAnalyzerFunctionalComplexity(ImmutableArray<DiagnosticAnalyzer>.Builder builder)
 {
     var analyzer = new FunctionComplexity();
     if (!AnalyzerIds.Contains(analyzer.SupportedDiagnostics.Single().Id))
     {
         return;
     }
     analyzer.Maximum = int.Parse(
         Parameters[analyzer.SupportedDiagnostics.Single().Id].Single()["maximumFunctionComplexityThreshold"],
         NumberStyles.None, CultureInfo.InvariantCulture);
     builder.Add(analyzer);
 }
 public void FunctionComplexity()
 {
     var diagnostic = new FunctionComplexity {Maximum = 3};
     Verifier.VerifyAnalyzer(@"TestCases\FunctionComplexity.cs", diagnostic);
 }