SharpSource icon indicating copy to clipboard operation
SharpSource copied to clipboard

surfacing defects at compile time and preventing issues that would otherwise go unnoticed

Results 35 SharpSource issues
Sort by recently updated
recently updated
newest added

Consider using same approach as in https://github.com/Vannevelj/sensitivity but straight as an analyzer.

enhancement

```cs new ImmutableArray() ``` creates an empty struct. Correct usage is ```cs ImmutableArray.Create() ``` https://learn.microsoft.com/en-us/dotnet/api/system.collections.immutable.immutablearray.create?view=net-7.0#system-collections-immutable-immutablearray-create-1

enhancement

```cs if (len is > 2014) { stackalloc int[len] } if (options is { len > 2014 }) { stackalloc int[options.len] } ```

enhancement

Example: ```cs void DoThing(string a, int b) { DoThing(a, b); } ```

enhancement

We don't want negative values because they introduce subtle potential bugs. For example, in order to check whether a `[Flags]` enum has a certain flag set we have 3 common...

enhancement

```diff -Regex.IsMatch("", ""); +Regex.IsMatch("", "", RegexOptions.None, Timeout.InfiniteTimeSpan); ``` This prevents security issues where the combination of pattern and input result in a DoS.

enhancement

Right now it only suggests `Task`

enhancement
good first issue

`.Where()` followed by `.First()`, `.FirstOrDefault()`, `.Single()`, `.SingleOrDefault()`, `.Last()`, `.LastOrDefault()`, `.Sum()` or `.Count()` should just take the selector predicate inside the `Where()` clause

enhancement

According to [the struct design guidelines](https://msdn.microsoft.com/en-us/library/ms229031%28v=vs.110%29.aspx), a `struct` should always implement `IEquatable`. This complements Vannevelj/VSDiagnostics#182 as well.

enhancement
good first issue

Triggered on this: ```cs switch (trivia.Kind()) { case SyntaxKind.SingleLineCommentTrivia: case SyntaxKind.MultiLineCommentTrivia: case SyntaxKind.DocumentationCommentExteriorTrivia: case SyntaxKind.SingleLineDocumentationCommentTrivia: case SyntaxKind.MultiLineDocumentationCommentTrivia: case SyntaxKind.EndOfDocumentationCommentToken: case SyntaxKind.XmlComment: case SyntaxKind.XmlCommentEndToken: case SyntaxKind.XmlCommentStartToken: return true; default: return false;...

bug