Skip to content

Commit

Permalink
Update analyzers/src/SonarAnalyzer.Common/Rules/SpecifyTimeoutOnRegex…
Browse files Browse the repository at this point in the history
…Base.cs

Co-authored-by: Martin Strecker <103252490+martin-strecker-sonarsource@users.noreply.github.com>
  • Loading branch information
Corniel Nobel and martin-strecker-sonarsource committed Jul 14, 2022
1 parent 6238011 commit 0cebad0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private bool RegexMethodLacksTimeout(SyntaxNode node, SemanticModel model) =>
&& !NoBacktracking(method, node, model);

private static bool ContainsMatchTimeout(IMethodSymbol method) =>
method.Parameters.Any(x => x.Type.Is(KnownType.System_TimeSpan));
method.Parameters.Any(x => x.Name == "matchTimeout");

private bool NoBacktracking(IMethodSymbol method, SyntaxNode node, SemanticModel model) =>
method.Parameters.SingleOrDefault(x => x.Name == "options") is { } parameter
Expand Down

0 comments on commit 0cebad0

Please sign in to comment.