How many of you have used third-party libraries when writing your code? The question is rhetorical, because without the use of third-party libraries, the development of some products would have been delayed for a very, very long time, because to solve each problem, one would have to "reinvent the wheel". However, in addition to advantages, there are also disadvantages in using third-party libraries. One of these drawbacks recently touched upon the PVS-Studio analyzer for C #. For a long time, the analyzer could not complete the analysis of a large project due to the use of the SymbolFinder.FindReferencesAsync method from the Roslyn API in the V3083 diagnostics.
PVS-Studio, , . , , . ! . Alarm! Alarm! ! , . , 3 C# . V3083. , . V3083 C# . , :
public class IncorrectEventUse
{
public event EventHandler EventOne;
protected void InvokeEventTwice(object o, Eventers args)
{
if (EventOne != null)
{
EventOne(o, args);
EventOne.Invoke(o, args);
}
}
}
V3083 EventOne InvokeEventTwice. . , V3083 :
;
, ;
, .
- .
- . V3083 , ( : Visual Studio, Rider, SonarQube), . , . Roslyn API SymbolFinder.FindReferencesAsync, V3083, " ".
: , , . . , - . , , . 100 % V3083.
V3083
, , , . , , open-source ( 90 ). open-source ? " ", , . V3083. , , – V3083 . . SymbolFinder.FindReferencesAsync V3083 9 %. - , , :
, , - V3083.
, Roslyn API, ! . , SymbolFinder.FindReferencesAsync, Microsoft.CodeAnalysis.FindSymbols.SymbolFinder, .
PVS-Studio, .
V3083 , 7.12 SymbolFinder.FindReferencesAsync.
, C# , V3083. , , . 50, .
, : Valery Komarov. Roslyn API: Why PVS-Studio Was Analyzing the Project So Long.