Skip to content

Commit

Permalink
Fix S3900 and S2259 FN: Support method dereference (#7011)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-mikula-sonarsource committed Apr 4, 2023
1 parent 1969950 commit 263a4f8
Show file tree
Hide file tree
Showing 13 changed files with 395 additions and 1 deletion.
13 changes: 13 additions & 0 deletions analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,19 @@
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'converter' before using it.",
"location": {
"uri": "sources\Automapper\src\AutoMapper\Configuration\MappingExpressionBase.cs",
"region": {
"startLine": 477,
"startColumn": 26,
"endLine": 477,
"endColumn": 35
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'typeMap' before using it.",
"location": {
"uri": "sources\Automapper\src\AutoMapper\Configuration\MemberConfigurationExpression.cs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,19 @@
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'converter' before using it.",
"location": {
"uri": "sources\Automapper\src\AutoMapper\Configuration\MappingExpressionBase.cs",
"region": {
"startLine": 477,
"startColumn": 26,
"endLine": 477,
"endColumn": 35
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'typeMap' before using it.",
"location": {
"uri": "sources\Automapper\src\AutoMapper\Configuration\MemberConfigurationExpression.cs",
Expand Down
52 changes: 52 additions & 0 deletions analyzers/its/expected/Nancy/Nancy--net452-S3900.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
"location": {
"uri": "sources\Nancy\src\Nancy\AfterPipeline.cs",
"region": {
"startLine": 40,
"startColumn": 20,
"endLine": 40,
"endColumn": 28
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'pipeline' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\AfterPipeline.cs",
"region": {
"startLine": 67,
"startColumn": 13,
"endLine": 67,
Expand Down Expand Up @@ -97,6 +110,19 @@
"location": {
"uri": "sources\Nancy\src\Nancy\BeforePipeline.cs",
"region": {
"startLine": 42,
"startColumn": 20,
"endLine": 42,
"endColumn": 28
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'pipeline' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\BeforePipeline.cs",
"region": {
"startLine": 70,
"startColumn": 13,
"endLine": 70,
Expand Down Expand Up @@ -743,6 +769,19 @@
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'strategy' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\DefaultTypeCatalog.cs",
"region": {
"startLine": 36,
"startColumn": 90,
"endLine": 36,
"endColumn": 98
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'context' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\Diagnostics\DefaultRequestTracing.cs",
Expand Down Expand Up @@ -1228,6 +1267,19 @@
"location": {
"uri": "sources\Nancy\src\Nancy\ErrorPipeline.cs",
"region": {
"startLine": 45,
"startColumn": 20,
"endLine": 45,
"endColumn": 28
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'pipeline' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\ErrorPipeline.cs",
"region": {
"startLine": 73,
"startColumn": 13,
"endLine": 73,
Expand Down
52 changes: 52 additions & 0 deletions analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
"location": {
"uri": "sources\Nancy\src\Nancy\AfterPipeline.cs",
"region": {
"startLine": 40,
"startColumn": 20,
"endLine": 40,
"endColumn": 28
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'pipeline' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\AfterPipeline.cs",
"region": {
"startLine": 67,
"startColumn": 13,
"endLine": 67,
Expand Down Expand Up @@ -97,6 +110,19 @@
"location": {
"uri": "sources\Nancy\src\Nancy\BeforePipeline.cs",
"region": {
"startLine": 42,
"startColumn": 20,
"endLine": 42,
"endColumn": 28
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'pipeline' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\BeforePipeline.cs",
"region": {
"startLine": 70,
"startColumn": 13,
"endLine": 70,
Expand Down Expand Up @@ -743,6 +769,19 @@
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'strategy' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\DefaultTypeCatalog.cs",
"region": {
"startLine": 36,
"startColumn": 90,
"endLine": 36,
"endColumn": 98
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'context' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\Diagnostics\DefaultRequestTracing.cs",
Expand Down Expand Up @@ -1228,6 +1267,19 @@
"location": {
"uri": "sources\Nancy\src\Nancy\ErrorPipeline.cs",
"region": {
"startLine": 45,
"startColumn": 20,
"endLine": 45,
"endColumn": 28
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'pipeline' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy\ErrorPipeline.cs",
"region": {
"startLine": 73,
"startColumn": 13,
"endLine": 73,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\DataAnnotationsValidatorAdapter.cs",
"region": {
"startLine": 48,
"startColumn": 60,
"endLine": 48,
"endColumn": 69
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'attribute' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\DataAnnotationsValidatorAdapter.cs",
"region": {
"startLine": 89,
"startColumn": 17,
"endLine": 89,
Expand All @@ -41,6 +54,19 @@
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'attribute' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\RangeValidatorAdapter.cs",
"region": {
"startLine": 43,
"startColumn": 55,
"endLine": 43,
"endColumn": 64
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'descriptor' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\RangeValidatorAdapter.cs",
Expand All @@ -54,6 +80,32 @@
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'attribute' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\RangeValidatorAdapter.cs",
"region": {
"startLine": 48,
"startColumn": 55,
"endLine": 48,
"endColumn": 64
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'attribute' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\RegexValidatorAdapter.cs",
"region": {
"startLine": 40,
"startColumn": 50,
"endLine": 40,
"endColumn": 59
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'descriptor' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\RegexValidatorAdapter.cs",
Expand All @@ -80,6 +132,19 @@
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'attribute' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\RequiredValidatorAdapter.cs",
"region": {
"startLine": 42,
"startColumn": 52,
"endLine": 42,
"endColumn": 61
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'descriptor' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\RequiredValidatorAdapter.cs",
Expand All @@ -93,6 +158,32 @@
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'attribute' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\RequiredValidatorAdapter.cs",
"region": {
"startLine": 46,
"startColumn": 57,
"endLine": 46,
"endColumn": 66
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'attribute' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\StringLengthValidatorAdapter.cs",
"region": {
"startLine": 40,
"startColumn": 57,
"endLine": 40,
"endColumn": 66
}
}
},
{
"id": "S3900",
"message": "Refactor this method to add validation of parameter 'descriptor' before using it.",
"location": {
"uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\StringLengthValidatorAdapter.cs",
Expand Down
Loading

0 comments on commit 263a4f8

Please sign in to comment.