sonar-dotnet
sonar-dotnet copied to clipboard
Code analyzer for C# and VB.NET projects
`ThrowsOrReturnsNull ` iterates the whole tree couple of times - there might be a way to optimize it. Additionally as mentioned in a comment int the method "For simplicity this...
### Description In case a tracked property is set to a safe value in a global statement after the object initialization, the tracker will fail to track it. ### Repro...
### Description S4057 does not raise and issue in case it is part of an AnonymousObjectMemberDeclarator. ### Repro steps ``` var a = new { MyTable1 = new DataTable {...
Originally proposed by community https://community.sonarsource.com/t/67647/2 ### Background The extension methods defined in LoggerExtensions have overloads that expect combinations of `Exception`, `EventId` (and `LogLevel`) as their first parameters and `string message`...
Fixes #3879
### Description Rule S2187, is raising a false positive when Test methods are declared in nested types ### Repro steps ``` [TestFixture] public class A // Noncompliant, FP - In...
### Description The error message for S3353 is insufficient. ### Repro steps In a project with C# 9 or below, add this code ```CS public class Test { public void...
### Description Null pointers should not be dereferenced FP  `IsStringLiteral` does a null-check inside and returns false if null This would need cross-procedural analysis to make it work. ###...
Documents #5744
Rule S4057 is [querying ](https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/src/SonarAnalyzer.CSharp/Rules/SetLocaleForDataTypes.cs#L68) the semantic model for every object creation node, while the rule is interested only in two specific types of objects. Maybe it's better to do...