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

See: [RSPEC-2289](https://jira.sonarsource.com/browse/RSPEC-2289), and #365 ---------------- # Description The Obsolete attribute can be applied with or without arguments, but marking something Obsolete without including advice as to why it's obsolete or...

### Description [S2930](https://rules.sonarsource.com/csharp/RSPEC-2930) doesn't recognize Dispose() and DisposeAsync() calls made in DisposeAsync() method, resulting in false-positives: ![image](https://user-images.githubusercontent.com/18292081/179947229-c7cd906f-4117-453c-9484-e5a3b54e374e.png) Issue is similar to #3324 ### Repro steps Analyze following code: ```csharp namespace...

Type: False Positive
Area: C#

### Description Rule S3220 raises an issue even though the method that is overloaded is not accessible at the invocation. The issue was reported by community: https://community.sonarsource.com/t/false-positive-s3220-method-calls-should-not-resolve-ambiguously-to-overloads-with-params-checks-private-constructors/58681 ### Repro steps...

Type: False Positive
Area: C#

S4057 is processing all the object creations in a source file. For each object creation, the rule is [querying ](https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/src/SonarAnalyzer.CSharp/Rules/SetLocaleForDataTypes.cs#L67) the semantic model. Based on the fact that the rule...

Type: Performance

See: [community.sonarsource.com](https://community.sonarsource.com/t/regex-evaluation-should-have-a-time-out-specified/40971), And RSPEC PR: https://github.com/SonarSource/rspec/pull/1188 # Description When using `System.Text.RegularExpressions` to process untrusted input, [pass a timeout](https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices). A malicious user can provide input to RegularExpressions causing a [Denial-of-Service attack](https://www.us-cert.gov/ncas/tips/ST04-015)....

Moved logic to a base class, and added VB.NET tests.

### Description When writing a method that uses `yield return` to (intentionally) yield an infinite-length sequence, SonarSource reported this warning: ``` S2190: Add a way to break out of this...

False Positive

OpenCover (https://github.com/OpenCover/opencover) has been archived. We should use `coverlet` instead (this is what we use in other repos). Related work in this repo or others: - https://github.com/SonarSource/sonar-dotnet/pull/5602 - https://github.com/SonarSource/sonar-dotnet/pull/5658 -...

Type: Tooling

This snippet ``` public class SomeException : Exception { } ``` produces >S3925 Update this implementation of 'ISerializable' to conform to the recommended serialization pattern. There are 9 different things...

Type: Improvement
Area: C#