CA1001 implement IDisposable on async method

That’s because compiler generates state machine from your async method, and that state machine class (named <Do>d__0 in this case) contains field of type Disposable but does not itself implements IDisposable interface. It doesn’t make much sense for analyzer to analyze compiler generated code (and this <Do>d__0 class is marked with CompilerGenerated attribute). Fortunately, there … Read more

Tools for generating Haskell function dependency (control flow) graph?

Yes, there certainly are. If you look in the Development category on Hackage, you’ll find tools for: graphing package dependencies — n.b requres older cabal graphing module dependencies graphing function calls graphing running data structures In particular, SourceGraph contains many analysis passes, including: visualizing function calls computing cyclomatic complexity visualizing module imports Other tools that … Read more

Static Actionscript code analysis possibilities

Update Nov 2018: It would appear that Structure101 (new download page) no longer has an ActionScript variant. Original answer, links outdated: Download Structure101g and select the Actionscript flavor after installing the software. I’ve confirmed that it is able to map out class level and even function call dependencies in Flex/AS3 projects, and generate a visual … Read more

How to fix Visual Studio 2022 Warning CA1416 “Call site reachable by all platforms” but “only supported on: ‘windows'”?

I had success removing the CA1416 warnings by adding the following decorator to the top of the containing class: [System.Runtime.Versioning.SupportedOSPlatform(“windows”)] I’m only on VS2019 and using .net 5, but it may work for you. I tried this with VS2019 .net5 console project (top of class Program) and a .net5 class library (top of the class). … Read more

Enabling Microsoft’s Code Analysis on .NET Core Projects

Update 2021 FxCopAnalyzers have been deprecated, and it is now recommended to use the more limited Microsoft.CodeAnalysis.NetAnalyzers package. See https://github.com/dotnet/roslyn-analyzers and https://learn.microsoft.com/en-us/visualstudio/code-quality/migrate-from-fxcop-analyzers-to-net-analyzers?view=vs-2019 for more details. Update Apparently the right way to do this is to install the Microsoft.CodeAnalysis.FxCopAnalyzers NuGet package. This works great, even on ASP.NET Core projects, and doesn’t require the <RunCodeAnalysis> flag at … Read more

tech