sonar-dotnet icon indicating copy to clipboard operation
sonar-dotnet copied to clipboard

Code analyzer for C# and VB.NET projects

Results 507 sonar-dotnet issues
Sort by recently updated
recently updated
newest added

### Description Where an attempt is made to check if an enum value has a flag set, then SonarC# should verify that this can be done correctly. This issue suggests...

Rule Idea

RSPEC draft of [S3047](https://sonarsource.github.io/rspec/#/rspec/S3047/csharp) was deleted for C# and VB.NET as non-implemented. The rule is implemented for Java only.

Rule Idea

RSPEC draft of [S3516](https://sonarsource.github.io/rspec/#/rspec/S2752/csharp) was deleted as non-implemented. The rule is already implemented for Python, Java, and JS, in the context of https://sonarsource.atlassian.net/browse/MMF-1813, and makes sense for both C# and...

Rule Idea

### Description This scenario should be valid for deserialization purposes. Coming from the community - https://community.sonarsource.com/t/s4275-getters-and-setters-should-access-the-expected-fields/24581/3 ``` public class ReproDeserializationScenario { private readonly List _data = new List(); public List...

False Positive

Requested by community: https://community.sonarsource.com/t/c-rule-request-classes-should-not-have-too-many-methods/17978

Rule Idea

### Description The rule incorrectly suggests to refactor constructor by adding argument checks for arguments that are dereferenced in the this/base initializer. We should consider changing the rule message to...

False Negative

RSPEC draft of [S1247](https://sonarsource.github.io/rspec/#/rspec/S1247/csharp) was deleted for C# and VB.NET as non-implemented. ```cs for(int i = 0, sum = 0; i < array.Length; i++) //Noncompliant { sum += worth[i]; }...

Rule Idea

### Description False negative with nullable argument value. ### Repro steps This code doesn't throw by rule, but rule has been violated. ```csharp void NotNullableParamVoid(int a, int b) { //...

False Negative

### Description Currently, the rule will report an issue only on effectively `private` methods. The idea of this improvement is to report on methods whatever their accessibility. ### TODO *...

False Negative

RSPEC draft of [S139](https://sonarsource.github.io/rspec/#/rspec/S139/csharp) was deleted for C# as non-implemented (the rule is already implemented for VB6 and VBNET). **Noncompliant** int a1 = b + c; // This is a...

Rule Idea