Antonio Aversa

Results 21 issues of Antonio Aversa

Cover `SyntaxNodeExtensions.GetBody`, introduced in https://github.com/SonarSource/sonar-dotnet/pull/8584 but not covered.

Type: Tests

An array of an [inline array](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#inline-arrays), while not being explicitly defined as a multidimensional or jagged array, has the same memory layout of those. Moreover, it is accessed in the...

Type: False Negative
Area: C#
Area: C#12

```cs public class SomeClass { object x; object y; public object Y { get { return x; } // FN set { x ??= value; } // FN } }...

Type: False Negative
Area: C#
Area: C#12

New [C# 12 collection expressions](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#collection-expressions) allow to make collection initialization even shorter than it used to be with [Implicitly typed arrays](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/arrays#implicitly-typed-arrays). ```cs void ExplicitTypeDeclaration() { int[] a1 = [1, 2,...

Type: False Negative
Area: C#
Area: C#12

The corresponding issue for v7: https://github.com/SonarSource/sonar-dotnet/pull/6155 To be done after the release of .NET 8. Previous attempt at performing this task, before the release of .NET 8, has resulted into...

Area: C#
Type: Tooling
Area: C#12

Related to [C# 12 Zero-overhead member access](https://github.com/dotnet/runtime/issues/81741). Using `UnsafeAccessorAttribute` on generic methods results in a `System.BadImageFormatException Invalid usage of UnsafeAccessorAttribute`. ```cs using System.Runtime.CompilerServices; [UnsafeAccessor(UnsafeAccessorKind.Constructor)] extern static UserData CallPrivateConstructor(); _ =...

Area: C#
Type: Rule Idea
Area: C#12

While [S3011](https://sonarsource.github.io/rspec/#/rspec/S3011/csharp) explicitly talks about using reflection to get access to members that otherwise could not be accessed by direct dereference, the focus of the rule is on increased accessibility,...

Type: False Negative
Area: C#
Area: C#12

Related to [C# 12 Zero-overhead member access](https://github.com/dotnet/runtime/issues/81741). Using `UnsafeAccessorAttribute` on a `extern` method with the parameters not matching the target results in a `System.MissingMethodException Method not found`. ```cs using System.Runtime.CompilerServices;...

Area: C#
Type: Rule Idea
Area: C#12

The `Name` parameter of the `UnsafeAccessorAttribute` should be: - not specified, when kind is `UnsafeAccessorKind.Constructor` - the name of an existing member (including unspeakable fields), when kind is `UnsafeAccessorKind.Method`, `UnsafeAccessorKind.StaticMethod`,...

Area: C#
Type: Rule Idea
Area: C#12

Release note: https://github.com/SonarSource/sonar-dotnet/releases/tag/9.18.0.83559 Summary: Hardening: 5 FPs for C#, 1 FPs for VB.NET, 2 message improvements for C#, 1 rule deprecation

Type: Improvement
Area: Analyzer
Language: C#