ErrorProne.NET icon indicating copy to clipboard operation
ErrorProne.NET copied to clipboard

Set of roslyn-based analyzers for catching common C# errors (inspired by Google's error-prone)

Results 106 ErrorProne.NET issues
Sort by recently updated
recently updated
newest added

List myStructTupleList = new (); MyMethod(in myStruct)//example method MyMethod(in myStructTupleList[0].ms) //does not compile with the "in" keyword

`ArraySegment` is a readonly struct, but analyzer thinks it is not and always gives ESP06 warning.

In the README file there is a link to a Visual Studio pipeline but it appears to be broken now: https://github.com/SergeyTeplyakov/ErrorProne.NET/blob/master/ReadMe.md The image isn't loading and when clicked, leads to...

We've started to use the [generated HTTP clients](https://devblogs.microsoft.com/dotnet/generating-http-api-clients-using-visual-studio-connected-services/) that uses [NSwag](https://github.com/RicoSuter/NSwag) to generate a typed client, and EPS01 "Struct 'ObjectResponseResult' can be made readonly" is showing up on the generated...

This is with current head of master f6787c08d76ca761eee3d103f43c4289bbb4d3cb, running in VS 16.11.7. Packaging issue suspected, I'm investigating. ![image](https://user-images.githubusercontent.com/1101693/144426082-3284f066-17da-4e0e-b506-bd0091a1f48c.png) ``` System.MissingMethodException : Method not found: 'System.String ErrorProne.NET.StructAnalyzers.ExplicitInParameterAnalyzer.get_DiagnosticId()'. at ErrorProne.NET.StructAnalyzers.ExplicitInParameterCodeFixProvider.get_FixableDiagnosticIds() at Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetAndTestFixableDiagnosticIds(CodeFixProvider...

At current HEAD of master, it's this (literally): ``` { "sdk": { > Stashed changes } } ``` Which version should it be?

This should be flagged as suspicious code: ```csharp public struct MyDisposable : IDisposable { public void Dispose() { } } internal class Program { static Task FooBar() { return Task.FromResult(0);...

EPS12 falsely reports that a method can be readonly on a non-readonly struct. This is nonsense, since there is no such thing (yet) as a readonly method. A picture says...

For instance, if the application uses C# 7.2, do not emit a warning that a method can be made readonly, because the fix will produce a non-compilable code. Consider emitting...