diff --git a/analyzers/its/expected/Ember-MM/S3247-Ember.Plugins.json b/analyzers/its/expected/Ember-MM/S3247-Ember.Plugins.json index 2e89f1050d7..360d1620d0b 100644 --- a/analyzers/its/expected/Ember-MM/S3247-Ember.Plugins.json +++ b/analyzers/its/expected/Ember-MM/S3247-Ember.Plugins.json @@ -2,7 +2,7 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Ember-MM/Ember.Plugins/PluginManager.cs#L196", "Location": "Line 196 Position 25-53" } diff --git a/analyzers/its/expected/Nancy/S3247-Nancy-net452.json b/analyzers/its/expected/Nancy/S3247-Nancy-net452.json index af13819a733..68e54c8049a 100644 --- a/analyzers/its/expected/Nancy/S3247-Nancy-net452.json +++ b/analyzers/its/expected/Nancy/S3247-Nancy-net452.json @@ -2,109 +2,109 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/DynamicDictionaryValue.cs#L498", "Location": "Line 498 Position 17-43" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/DynamicDictionaryValue.cs#L541", "Location": "Line 541 Position 17-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/DynamicDictionaryValue.cs#L583", "Location": "Line 583 Position 17-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L187", "Location": "Line 187 Position 17-36" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L191", "Location": "Line 191 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L195", "Location": "Line 195 Position 22-41" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L257", "Location": "Line 257 Position 17-36" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L261", "Location": "Line 261 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L283", "Location": "Line 283 Position 17-36" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L288", "Location": "Line 288 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L309", "Location": "Line 309 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L329", "Location": "Line 329 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Json/Converters/TimeSpanConverter.cs#L73", "Location": "Line 73 Position 17-29" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Json/Converters/TimeSpanConverter.cs#L78", "Location": "Line 78 Position 17-30" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Json/Simple/NancySerializationStrategy.cs#L188", "Location": "Line 188 Position 17-34" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Json/Simple/NancySerializationStrategy.cs#L193", "Location": "Line 193 Position 17-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Responses/Negotiation/DefaultResponseNegotiator.cs#L83", "Location": "Line 83 Position 17-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/ViewEngines/SuperSimpleViewEngine/SuperSimpleViewEngine.cs#L182", "Location": "Line 182 Position 17-48" } diff --git a/analyzers/its/expected/Nancy/S3247-Nancy-netstandard2.0.json b/analyzers/its/expected/Nancy/S3247-Nancy-netstandard2.0.json index af13819a733..68e54c8049a 100644 --- a/analyzers/its/expected/Nancy/S3247-Nancy-netstandard2.0.json +++ b/analyzers/its/expected/Nancy/S3247-Nancy-netstandard2.0.json @@ -2,109 +2,109 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/DynamicDictionaryValue.cs#L498", "Location": "Line 498 Position 17-43" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/DynamicDictionaryValue.cs#L541", "Location": "Line 541 Position 17-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/DynamicDictionaryValue.cs#L583", "Location": "Line 583 Position 17-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L187", "Location": "Line 187 Position 17-36" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L191", "Location": "Line 191 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L195", "Location": "Line 195 Position 22-41" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L257", "Location": "Line 257 Position 17-36" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L261", "Location": "Line 261 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L283", "Location": "Line 283 Position 17-36" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L288", "Location": "Line 288 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L309", "Location": "Line 309 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Helpers/ReflectionUtils.cs#L329", "Location": "Line 329 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Json/Converters/TimeSpanConverter.cs#L73", "Location": "Line 73 Position 17-29" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Json/Converters/TimeSpanConverter.cs#L78", "Location": "Line 78 Position 17-30" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Json/Simple/NancySerializationStrategy.cs#L188", "Location": "Line 188 Position 17-34" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Json/Simple/NancySerializationStrategy.cs#L193", "Location": "Line 193 Position 17-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/Responses/Negotiation/DefaultResponseNegotiator.cs#L83", "Location": "Line 83 Position 17-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy/ViewEngines/SuperSimpleViewEngine/SuperSimpleViewEngine.cs#L182", "Location": "Line 182 Position 17-48" } diff --git a/analyzers/its/expected/Nancy/S3247-Nancy.Validation.DataAnnotations-net452.json b/analyzers/its/expected/Nancy/S3247-Nancy.Validation.DataAnnotations-net452.json index aef7d7ce93f..8e0e5b3afce 100644 --- a/analyzers/its/expected/Nancy/S3247-Nancy.Validation.DataAnnotations-net452.json +++ b/analyzers/its/expected/Nancy/S3247-Nancy.Validation.DataAnnotations-net452.json @@ -2,7 +2,7 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy.Validation.DataAnnotations/RangeValidatorAdapter.cs#L61", "Location": "Line 61 Position 16-31" } diff --git a/analyzers/its/expected/Nancy/S3247-Nancy.ViewEngines.Razor-net452.json b/analyzers/its/expected/Nancy/S3247-Nancy.ViewEngines.Razor-net452.json index a84e3bea1a6..26d20780a0a 100644 --- a/analyzers/its/expected/Nancy/S3247-Nancy.ViewEngines.Razor-net452.json +++ b/analyzers/its/expected/Nancy/S3247-Nancy.ViewEngines.Razor-net452.json @@ -2,19 +2,19 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy.ViewEngines.Razor/NancyRazorViewBase.cs#L249", "Location": "Line 249 Position 17-49" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy.ViewEngines.Razor/NancyRazorViewBase.cs#L254", "Location": "Line 254 Position 17-60" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Nancy/src/Nancy.ViewEngines.Razor/NancyRazorViewBase.cs#L270", "Location": "Line 270 Position 17-30" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka-netstandard2.0.json index 5f251c5cf85..c7ef90242c7 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka-netstandard2.0.json @@ -2,61 +2,61 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Actor/BuiltInActors.cs#L46", "Location": "Line 46 Position 22-42" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Actor/Futures.cs#L476", "Location": "Line 476 Position 21-39" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Actor/Futures.cs#L513", "Location": "Line 513 Position 22-55" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Actor/Futures.cs#L518", "Location": "Line 518 Position 22-38" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Actor/Futures.cs#L536", "Location": "Line 536 Position 22-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Actor/Futures.cs#L558", "Location": "Line 558 Position 26-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Actor/RepointableActorRef.cs#L526", "Location": "Line 526 Position 17-42" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Dispatch/CachingConfig.cs#L289", "Location": "Line 289 Position 17-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/IO/TcpOutgoingConnection.cs#L101", "Location": "Line 101 Position 25-61" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/IO/TcpOutgoingConnection.cs#L89", "Location": "Line 89 Position 21-58" }, @@ -68,31 +68,31 @@ }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Serialization/ByteArraySerializer.cs#L45", "Location": "Line 45 Position 17-30" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Serialization/NewtonSoftJsonSerializer.cs#L375", "Location": "Line 375 Position 21-33" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Serialization/NewtonSoftJsonSerializer.cs#L377", "Location": "Line 377 Position 21-35" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Serialization/NewtonSoftJsonSerializer.cs#L379", "Location": "Line 379 Position 21-37" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Util/Result.cs#L68", "Location": "Line 68 Position 17-33" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Cluster-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.Cluster-netstandard2.0.json index 5242faffb47..89756a20d84 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Cluster-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Cluster-netstandard2.0.json @@ -2,13 +2,13 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Cluster/ClusterActorRefProvider.cs#L181", "Location": "Line 181 Position 25-52" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Cluster/ClusterActorRefProvider.cs#L188", "Location": "Line 188 Position 30-58" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.DistributedData-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.DistributedData-netstandard2.0.json index 5bd840e2d3f..e832d425004 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.DistributedData-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.DistributedData-netstandard2.0.json @@ -2,43 +2,43 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/contrib/cluster/Akka.DistributedData/ORSet.cs#L521", "Location": "Line 521 Position 21-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/contrib/cluster/Akka.DistributedData/ORSet.cs#L533", "Location": "Line 533 Position 26-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/contrib/cluster/Akka.DistributedData/ORSet.cs#L570", "Location": "Line 570 Position 26-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/contrib/cluster/Akka.DistributedData/ORSet.cs#L593", "Location": "Line 593 Position 26-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/contrib/cluster/Akka.DistributedData/ReadAggregator.cs#L44", "Location": "Line 44 Position 17-41" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/contrib/cluster/Akka.DistributedData/ReadAggregator.cs#L46", "Location": "Line 46 Position 22-50" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/contrib/cluster/Akka.DistributedData/Replicator.Messages.cs#L214", "Location": "Line 214 Position 17-26" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Persistence-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.Persistence-netstandard2.0.json index 04696d92fb2..c18e4040fc2 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Persistence-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Persistence-netstandard2.0.json @@ -2,145 +2,145 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Eventsourced.cs#L631", "Location": "Line 631 Position 26-53" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Eventsourced.Lifecycle.cs#L101", "Location": "Line 101 Position 17-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Eventsourced.Lifecycle.cs#L107", "Location": "Line 107 Position 17-49" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Eventsourced.Lifecycle.cs#L113", "Location": "Line 113 Position 17-50" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Eventsourced.Lifecycle.cs#L119", "Location": "Line 119 Position 17-49" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Eventsourced.Lifecycle.cs#L66", "Location": "Line 66 Position 21-51" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Eventsourced.Lifecycle.cs#L67", "Location": "Line 67 Position 26-55" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Eventsourced.Lifecycle.cs#L68", "Location": "Line 68 Position 26-52" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/AsyncWriteJournal.cs#L363", "Location": "Line 363 Position 25-53" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/AsyncWriteProxy.cs#L304", "Location": "Line 304 Position 22-41" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/AsyncWriteProxy.cs#L468", "Location": "Line 468 Position 17-53" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/AsyncWriteProxy.cs#L474", "Location": "Line 474 Position 22-63" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L195", "Location": "Line 195 Position 17-42" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L236", "Location": "Line 236 Position 21-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L268", "Location": "Line 268 Position 21-46" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L274", "Location": "Line 274 Position 26-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L319", "Location": "Line 319 Position 30-55" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L324", "Location": "Line 324 Position 30-57" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L333", "Location": "Line 333 Position 25-48" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L338", "Location": "Line 338 Position 30-53" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L343", "Location": "Line 343 Position 30-55" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L348", "Location": "Line 348 Position 30-56" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs#L354", "Location": "Line 354 Position 26-51" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence/Journal/ReplayFilter.cs#L134", "Location": "Line 134 Position 17-43" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Persistence.Sql.Common-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.Persistence.Sql.Common-netstandard2.0.json index 923cc1e63c8..c5c988ad386 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Persistence.Sql.Common-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Persistence.Sql.Common-netstandard2.0.json @@ -2,7 +2,7 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/QueryExecutor.cs#L356", "Location": "Line 356 Position 17-59" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Persistence.TCK-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.Persistence.TCK-netstandard2.0.json index c859ac8923e..e1876ce1055 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Persistence.TCK-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Persistence.TCK-netstandard2.0.json @@ -2,7 +2,7 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Persistence.TCK/Serialization/JournalSerializationSpec.cs#L196", "Location": "Line 196 Position 21-38" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Remote-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.Remote-netstandard2.0.json index 79f55a69600..fba4b9d152e 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Remote-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Remote-netstandard2.0.json @@ -2,139 +2,139 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/RemoteSystemDaemon.cs#L126", "Location": "Line 126 Position 21-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/RemoteSystemDaemon.cs#L177", "Location": "Line 177 Position 22-50" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Serialization/SystemMessageSerializer.cs#L42", "Location": "Line 42 Position 17-30" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Serialization/SystemMessageSerializer.cs#L43", "Location": "Line 43 Position 17-32" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Serialization/SystemMessageSerializer.cs#L45", "Location": "Line 45 Position 17-30" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Serialization/SystemMessageSerializer.cs#L47", "Location": "Line 47 Position 17-33" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Serialization/SystemMessageSerializer.cs#L48", "Location": "Line 48 Position 17-29" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Serialization/SystemMessageSerializer.cs#L49", "Location": "Line 49 Position 17-31" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Serialization/SystemMessageSerializer.cs#L50", "Location": "Line 50 Position 17-30" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Serialization/SystemMessageSerializer.cs#L51", "Location": "Line 51 Position 17-46" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/DotNetty/AkkaLoggingHandler.cs#L141", "Location": "Line 141 Position 17-35" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/DotNetty/AkkaLoggingHandler.cs#L145", "Location": "Line 145 Position 22-46" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/FailureInjectorTransportAdapter.cs#L235", "Location": "Line 235 Position 17-31" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/FailureInjectorTransportAdapter.cs#L242", "Location": "Line 242 Position 17-31" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/FailureInjectorTransportAdapter.cs#L340", "Location": "Line 340 Position 17-29" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/FailureInjectorTransportAdapter.cs#L365", "Location": "Line 365 Position 17-29" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/ThrottleTransportAdapter.cs#L361", "Location": "Line 361 Position 17-46" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/ThrottleTransportAdapter.cs#L367", "Location": "Line 367 Position 22-52" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/ThrottleTransportAdapter.cs#L388", "Location": "Line 388 Position 22-48" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/ThrottleTransportAdapter.cs#L400", "Location": "Line 400 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/ThrottleTransportAdapter.cs#L420", "Location": "Line 420 Position 22-50" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/ThrottleTransportAdapter.cs#L449", "Location": "Line 449 Position 22-60" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/Transport/ThrottleTransportAdapter.cs#L478", "Location": "Line 478 Position 22-40" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Remote.TestKit-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.Remote.TestKit-netstandard2.0.json index 2460e01f213..e119251b2d6 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Remote.TestKit-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Remote.TestKit-netstandard2.0.json @@ -2,55 +2,55 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L101", "Location": "Line 101 Position 22-46" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L112", "Location": "Line 112 Position 22-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L138", "Location": "Line 138 Position 22-43" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L143", "Location": "Line 143 Position 22-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L51", "Location": "Line 51 Position 17-33" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L60", "Location": "Line 60 Position 22-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L70", "Location": "Line 70 Position 22-46" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L81", "Location": "Line 81 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote.TestKit/MsgEncoder.cs#L90", "Location": "Line 90 Position 22-44" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Streams-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.Streams-netstandard2.0.json index baa975bb4eb..decf7179364 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Streams-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Streams-netstandard2.0.json @@ -2,121 +2,121 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/ActorMaterializer.cs#L710", "Location": "Line 710 Position 17-57" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/ActorMaterializer.cs#L95", "Location": "Line 95 Position 17-41" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Actors/ActorPublisher.cs#L489", "Location": "Line 489 Position 17-35" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Actors/ActorPublisher.cs#L514", "Location": "Line 514 Position 22-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Actors/ActorSubscriber.cs#L164", "Location": "Line 164 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorMaterializerImpl.cs#L129", "Location": "Line 129 Position 21-42" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorMaterializerImpl.cs#L137", "Location": "Line 137 Position 26-49" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorMaterializerImpl.cs#L145", "Location": "Line 145 Position 26-52" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorMaterializerImpl.cs#L159", "Location": "Line 159 Position 26-47" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorMaterializerImpl.cs#L164", "Location": "Line 164 Position 26-52" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorMaterializerImpl.cs#L670", "Location": "Line 670 Position 17-39" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorProcessor.cs#L297", "Location": "Line 297 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorProcessor.cs#L299", "Location": "Line 299 Position 22-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorProcessor.cs#L313", "Location": "Line 313 Position 17-34" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorProcessor.cs#L317", "Location": "Line 317 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorProcessor.cs#L319", "Location": "Line 319 Position 22-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorProcessor.cs#L510", "Location": "Line 510 Position 17-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorProcessor.cs#L529", "Location": "Line 529 Position 22-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorRefSinkActor.cs#L73", "Location": "Line 73 Position 17-34" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/ActorRefSinkActor.cs#L78", "Location": "Line 78 Position 22-40" }, @@ -128,187 +128,187 @@ }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/Fusing/Fusing.cs#L821", "Location": "Line 821 Position 22-41" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/Fusing/GraphAssembly.cs#L205", "Location": "Line 205 Position 21-54" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/Fusing/GraphStages.cs#L408", "Location": "Line 408 Position 20-30" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/Fusing/StreamOfStreams.cs#L1270", "Location": "Line 1270 Position 26-43" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/Fusing/StreamOfStreams.cs#L1282", "Location": "Line 1282 Position 30-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/Fusing/StreamOfStreams.cs#L1284", "Location": "Line 1284 Position 30-43" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L117", "Location": "Line 117 Position 21-37" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L143", "Location": "Line 143 Position 26-46" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L463", "Location": "Line 463 Position 21-37" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L485", "Location": "Line 485 Position 21-38" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L502", "Location": "Line 502 Position 30-54" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L504", "Location": "Line 504 Position 30-50" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L530", "Location": "Line 530 Position 26-50" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L531", "Location": "Line 531 Position 26-48" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/IO/TcpStages.cs#L536", "Location": "Line 536 Position 26-45" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L2364", "Location": "Line 2364 Position 26-51" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L2423", "Location": "Line 2423 Position 17-44" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L2428", "Location": "Line 2428 Position 22-50" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L2434", "Location": "Line 2434 Position 22-52" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L299", "Location": "Line 299 Position 17-34" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L301", "Location": "Line 301 Position 17-31" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L747", "Location": "Line 747 Position 17-51" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L759", "Location": "Line 759 Position 17-39" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L760", "Location": "Line 760 Position 17-42" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/StreamLayout.cs#L761", "Location": "Line 761 Position 17-38" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/Transfer.cs#L592", "Location": "Line 592 Position 17-69" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/Transfer.cs#L614", "Location": "Line 614 Position 17-69" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/UntypedPublisher.cs#L71", "Location": "Line 71 Position 17-53" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/UntypedSubscriber.cs#L103", "Location": "Line 103 Position 17-55" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Implementation/UntypedVirtualPublisher.cs#L81", "Location": "Line 81 Position 17-60" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Streams/Stage/Stage.cs#L421", "Location": "Line 421 Position 34-76" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.TestKit-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.TestKit-netstandard2.0.json index 0ddf0497679..d9de012bbf9 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.TestKit-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.TestKit-netstandard2.0.json @@ -2,37 +2,37 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.TestKit/EventFilter/TestEventListener.cs#L33", "Location": "Line 33 Position 16-43" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.TestKit/EventFilter/TestEventListener.cs#L44", "Location": "Line 44 Position 21-36" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.TestKit/EventFilter/TestEventListener.cs#L52", "Location": "Line 52 Position 21-38" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.TestKit/EventFilter/TestEventListener.cs#L60", "Location": "Line 60 Position 21-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.TestKit/EventFilter/TestEventListener.cs#L68", "Location": "Line 68 Position 21-42" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.TestKit/EventFilter/TestEventListener.cs#L72", "Location": "Line 72 Position 21-48" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Tests.Performance-netcoreapp3.1.json b/analyzers/its/expected/akka.net/S3247-Akka.Tests.Performance-netcoreapp3.1.json index d950121edcf..5be017a23dc 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Tests.Performance-netcoreapp3.1.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Tests.Performance-netcoreapp3.1.json @@ -2,19 +2,19 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Tests.Performance/Actor/ActorThroughputSpec.cs#L83", "Location": "Line 83 Position 21-38" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Tests.Performance/Actor/ActorThroughputSpec.cs#L88", "Location": "Line 88 Position 26-40" }, { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Tests.Performance/Actor/ActorThroughputSpec.cs#L93", "Location": "Line 93 Position 26-47" } diff --git a/analyzers/its/expected/akka.net/S3247-Akka.Tests.Shared.Internals-netstandard2.0.json b/analyzers/its/expected/akka.net/S3247-Akka.Tests.Shared.Internals-netstandard2.0.json index 36cea6ebfde..6b8e04aa60d 100644 --- a/analyzers/its/expected/akka.net/S3247-Akka.Tests.Shared.Internals-netstandard2.0.json +++ b/analyzers/its/expected/akka.net/S3247-Akka.Tests.Shared.Internals-netstandard2.0.json @@ -2,7 +2,7 @@ "Issues": [ { "Id": "S3247", - "Message": "Replace this type-check-and-cast sequence with an \u0027as\u0027 and a null check.", + "Message": "Replace this type-check-and-cast sequence to use pattern matching.", "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Tests.Shared.Internals/Helpers/XAssert.cs#L56", "Location": "Line 56 Position 20-27" } diff --git a/analyzers/src/SonarAnalyzer.CSharp/Rules/CastShouldNotBeDuplicated.cs b/analyzers/src/SonarAnalyzer.CSharp/Rules/CastShouldNotBeDuplicated.cs index f34dc41a66e..748c60258f2 100644 --- a/analyzers/src/SonarAnalyzer.CSharp/Rules/CastShouldNotBeDuplicated.cs +++ b/analyzers/src/SonarAnalyzer.CSharp/Rules/CastShouldNotBeDuplicated.cs @@ -25,7 +25,7 @@ public sealed class CastShouldNotBeDuplicated : SonarDiagnosticAnalyzer { private const string DiagnosticId = "S3247"; private const string MessageFormat = "{0}"; - private const string ReplaceWithAsAndNullCheckMessage = "Replace this type-check-and-cast sequence with an 'as' and a null check."; + private const string UsePatternMatchingCheckMessage = "Replace this type-check-and-cast sequence to use pattern matching."; private const string RemoveRedundantCastAnotherVariableMessage = "Remove this cast and use the appropriate variable."; private const string RemoveRedundantCastMessage = "Remove this redundant cast."; @@ -76,7 +76,7 @@ private static void IsExpression(SonarSyntaxNodeReportingContext analysisContext if (isExpression.Right is TypeSyntax castType && isExpression.GetFirstNonParenthesizedParent() is IfStatementSyntax parentIfStatement) { - ReportPatternAtMainVariable(analysisContext, isExpression.Left, isExpression.GetLocation(), parentIfStatement.Statement, castType, ReplaceWithAsAndNullCheckMessage); + ReportPatternAtMainVariable(analysisContext, isExpression.Left, isExpression.GetLocation(), parentIfStatement.Statement, castType, UsePatternMatchingCheckMessage); } } diff --git a/analyzers/tests/SonarAnalyzer.Test/TestCases/CastShouldNotBeDuplicated.cs b/analyzers/tests/SonarAnalyzer.Test/TestCases/CastShouldNotBeDuplicated.cs index 6f75a08ff17..c854f605a10 100644 --- a/analyzers/tests/SonarAnalyzer.Test/TestCases/CastShouldNotBeDuplicated.cs +++ b/analyzers/tests/SonarAnalyzer.Test/TestCases/CastShouldNotBeDuplicated.cs @@ -16,7 +16,7 @@ class Program public void Foo(Object x) { - if (x is Fruit) // Noncompliant + if (x is Fruit) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { var f1 = (Fruit)x; // ^^^^^^^^ Secondary @@ -46,12 +46,12 @@ public void IgnoreMemberAccess(Fruit arg) _ = (Fruit)differentInstance.Property; } - if (f.Property is Fruit) // Noncompliant + if (f.Property is Fruit) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { _ = (Fruit)f.Property; // Secondary } - if (LocalProperty is Fruit) // Noncompliant + if (LocalProperty is Fruit) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { _ = (Fruit)LocalProperty; // Secondary } @@ -65,26 +65,26 @@ public void Bar(object x) } else { - var f2 = (Fruit)x; // Compliant - should be non compliant + var f2 = (Fruit)x; // Compliant - FN } } public void WithStructs(object x) { - if (x is int) // Noncompliant + if (x is int) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { var res = (int)x; // Secondary } - if (x is SomeStruct) // Noncompliant + if (x is SomeStruct) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { var res = (SomeStruct)x; // Secondary } } public void IsFollowedByAs(object x) { - if (x is Fruit) // Noncompliant + if (x is Fruit) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { _ = x as Fruit; // Secondary } @@ -95,20 +95,20 @@ public void IsFollowedByAs(object x) { } - if (x is SomeStruct?) // Noncompliant + if (x is SomeStruct?) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { _ = x as SomeStruct?; // Secondary } } public void IsFollowedByIs(object x) { - if (x is Fruit) // Noncompliant + if (x is Fruit) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { _ = x is Fruit; // Secondary } - if (x is SomeStruct?) // Noncompliant + if (x is SomeStruct?) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { _ = x is SomeStruct?; // Secondary } @@ -123,7 +123,7 @@ public void TakeIdentifierIntoAccount(object x) var c = (Fruit)f; } - if (someField is Fruit) // Noncompliant + if (someField is Fruit) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { var fruit = (Fruit)this.someField; // ^^^^^^^^^^^^^^^^^^^^^ Secondary @@ -145,7 +145,7 @@ public class Foo { public void Process(object message) { - if (message is Bar/*comment*/) // Noncompliant + if (message is Bar/*comment*/) // Noncompliant {{Replace this type-check-and-cast sequence to use pattern matching.}} { var sub = (Bar/**/) message; // Secondary }