v2.9.5-beta1.final
Pre-release
Pre-release
Pre-release build of Roslyn-analyzers based on Microsoft.CodeAnalysis 2.9.0 NuGet packages. Contains following important bug fixes and new analyzers/fixers on top of v2.9.4 release
Bug Fixes
- Critical Performance: Fixed memory leak in flow analysis results cache which leads to OOM exceptions and crashes on large solution. This is applicable for all rules
- Critical Reliability: Hardened all the analyzers and fixers from crashes due to
Single
orSingleOrDefault
invocations. - CA1065: Fixed false positives caused by breaking changes in the IOperation tree shape for throw operations.
- CA1067: Fixed false positives.
- CA1708: Fix high memory allocations in the rule implementation
- CA1721: Fixed false positives.
- CA2000: Fixed false positives
- CA2234: Fixed false positives
- CA2327: Do not use insecure JsonSerializerSettings -- Fixed InvalidCastException
- CA3147: Mark verb handlers with ValidateAntiForgeryToken -- Now handles Task-based ASP.NET MVC controller action methods
- CA3075: Insecure DTD processing in XML -- Fixed NullReferenceException.
- CA3076: Insecure XSLT script processing -- Fixed ArgumentOutOfRangeException.
- CA5390: Do Not Hard Code Encryption Key -- Treats Encoding.GetBytes() as a potentially hardcoded key. Also considers newer .NET Core 3.0 AesGcm and AesCcm APIs.
Additional analyzers/fixers:
Added
- Performance
- CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used -- Enabled by default
- Security
- CA2329: Do not deserialize with JsonSerializer using an insecure configuration
- CA2330: Ensure that JsonSerializer has a secure configuration when deserializing
- CA5391: Use antiforgery tokens in ASP.NET Core MVC controllers -- Enabled by default
- CA5392: Use DefaultDllImportSearchPaths attribute for P/Invokes -- Enabled by default
- CA5393: Do not use unsafe DllImportSearchPath value -- Enabled by default
- CA5394: Do not use insecure randomness
- CA5395: Miss HttpVerb attribute for action methods
- CA5396: Set HttpOnly to true for HttpCookie
- CA5397: Do not use deprecated SslProtocols values -- Enabled by default
- CA5398: Avoid hardcoded SslProtocols values
- CA5399: Definitely disable HttpClient certificate revocation list check
- CA5400: Ensure HttpClient certificate revocation list check is not disabled
Changed
- Security
- CA5389: Do Not Add Archive Item's Path To The Target File System Path -- Now disabled by default
- CA5390: Do Not Hard Code Encryption Key -- Now disabled by default
New Analyzer Configuration options
- CA1031: Add a configurable option
disallowed_symbol_names
to to allow configuration of disallowed exception types. - CA1062: Add configurable option
exclude_extension_method_this_parameter
for CA1062 to skip analysis of extension method 'this' parameter. - CA1801: Respect existing option
api_surface
for CA1801 (Review unused parameters). - CA1802: Add configuration option
required_modifiers
for CA1802. CA1802 only flags static readonly flags by default. This matches the legacy FxCop implementation for compat reasons. With this change, users can make the rule more aggressive by also flagging instance fields - CA2241: Add a new configurable option
additional_string_formatting_methods
for CA2241. CA2241 considers String.Format and Console.WriteLine as special formatting methods to validate the callsites for formatting arguments. This change allows end users to supply additional formatting methods that should be validated.
Works with VS 2017.9 or later.