Open pavel-mikula-sonarsource opened 4 years ago
Another community topic where
166.327 97 SonarAnalyzer.CSharp,
10.102 5 SonarAnalyzer.Rules.CSharp.CollectionQuerySimplification
There should be single registration for SyntaxKind.InvocationExpression
instead of 3.
CheckCountCall
is fast.
CheckExtensionMethodsOnIEnumerable
and CheckToCollectionCalls
are slow and could share some parts.
As a side effect of https://discuss.sonarsource.com/t/slow-c-analysis/6329,
CollectionQuerySimplification
took 5% of analysis time.We can improve the implementation by sharing the
methodSymbol
between all 3 checks and by checking the name from syntax before querying the symbol.