diff --git a/analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json b/analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json index c603eb709b2..e0c8fc8155b 100644 --- a/analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json +++ b/analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json @@ -405,19 +405,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'memberNames' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\Configuration\MappingExpression.cs", -"region": { -"startLine": 37, -"startColumn": 39, -"endLine": 37, -"endColumn": 50 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'memberOptions' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Configuration\MappingExpression.cs", @@ -2186,32 +2173,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'sourceMemberInfo' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\QueryMapperVisitor.cs", -"region": { -"startLine": 224, -"startColumn": 51, -"endLine": 224, -"endColumn": 67 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'sourceMemberInfo' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\QueryMapperVisitor.cs", -"region": { -"startLine": 231, -"startColumn": 63, -"endLine": 231, -"endColumn": 79 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'config' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\QueryMapperVisitor.cs", diff --git a/analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json b/analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json index c603eb709b2..e0c8fc8155b 100644 --- a/analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json +++ b/analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json @@ -405,19 +405,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'memberNames' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\Configuration\MappingExpression.cs", -"region": { -"startLine": 37, -"startColumn": 39, -"endLine": 37, -"endColumn": 50 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'memberOptions' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Configuration\MappingExpression.cs", @@ -2186,32 +2173,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'sourceMemberInfo' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\QueryMapperVisitor.cs", -"region": { -"startLine": 224, -"startColumn": 51, -"endLine": 224, -"endColumn": 67 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'sourceMemberInfo' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\QueryMapperVisitor.cs", -"region": { -"startLine": 231, -"startColumn": 63, -"endLine": 231, -"endColumn": 79 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'config' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\QueryMapperVisitor.cs", diff --git a/analyzers/its/expected/Ember-MM/generic.EmberCore.NMT-{84B2143A-D04F-4262-923D-21AEDF86E2B7}-S3900.json b/analyzers/its/expected/Ember-MM/generic.EmberCore.NMT-{84B2143A-D04F-4262-923D-21AEDF86E2B7}-S3900.json index a246f4a1a66..301b2b91916 100644 --- a/analyzers/its/expected/Ember-MM/generic.EmberCore.NMT-{84B2143A-D04F-4262-923D-21AEDF86E2B7}-S3900.json +++ b/analyzers/its/expected/Ember-MM/generic.EmberCore.NMT-{84B2143A-D04F-4262-923D-21AEDF86E2B7}-S3900.json @@ -2,32 +2,6 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 548, -"startColumn": 77, -"endLine": 548, -"endColumn": 86 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 548, -"startColumn": 153, -"endLine": 548, -"endColumn": 162 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'id' before using it.", "location": { "uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", @@ -41,227 +15,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 554, -"startColumn": 64, -"endLine": 554, -"endColumn": 73 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 560, -"startColumn": 52, -"endLine": 560, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 562, -"startColumn": 52, -"endLine": 562, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 564, -"startColumn": 52, -"endLine": 564, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 581, -"startColumn": 76, -"endLine": 581, -"endColumn": 85 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 581, -"startColumn": 116, -"endLine": 581, -"endColumn": 125 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 582, -"startColumn": 45, -"endLine": 582, -"endColumn": 54 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 583, -"startColumn": 37, -"endLine": 583, -"endColumn": 46 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 586, -"startColumn": 45, -"endLine": 586, -"endColumn": 54 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 587, -"startColumn": 37, -"endLine": 587, -"endColumn": 46 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 590, -"startColumn": 53, -"endLine": 590, -"endColumn": 62 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 592, -"startColumn": 31, -"endLine": 592, -"endColumn": 40 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 593, -"startColumn": 87, -"endLine": 593, -"endColumn": 96 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 600, -"startColumn": 98, -"endLine": 600, -"endColumn": 107 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curMovie' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 627, -"startColumn": 42, -"endLine": 627, -"endColumn": 51 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curShow' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 643, -"startColumn": 77, -"endLine": 643, -"endColumn": 85 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curShow' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 643, -"startColumn": 152, -"endLine": 643, -"endColumn": 160 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'id' before using it.", "location": { "uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", @@ -275,71 +28,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter '_curShow' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 647, -"startColumn": 47, -"endLine": 647, -"endColumn": 55 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curShow' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 656, -"startColumn": 112, -"endLine": 656, -"endColumn": 120 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curShow' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 660, -"startColumn": 37, -"endLine": 660, -"endColumn": 45 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curShow' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 696, -"startColumn": 77, -"endLine": 696, -"endColumn": 85 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curShow' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 696, -"startColumn": 152, -"endLine": 696, -"endColumn": 160 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter '_curSeason' before using it.", "location": { "uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", @@ -353,45 +41,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter '_curEpisode' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 728, -"startColumn": 77, -"endLine": 728, -"endColumn": 88 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curEpisode' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 728, -"startColumn": 202, -"endLine": 728, -"endColumn": 213 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curEpisode' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 728, -"startColumn": 257, -"endLine": 728, -"endColumn": 268 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'epid' before using it.", "location": { "uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", @@ -402,32 +51,6 @@ "endColumn": 51 } } -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curEpisode' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 732, -"startColumn": 73, -"endLine": 732, -"endColumn": 84 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter '_curEpisode' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\generic.EmberCore.NMT\dlgNMTMovies.vb", -"region": { -"startLine": 735, -"startColumn": 93, -"endLine": 735, -"endColumn": 104 -} -} } ] } diff --git a/analyzers/its/expected/Ember-MM/scraper.EmberCore.XML-{E567C031-1F7B-4637-9B3A-806988DE50CF}-S3900.json b/analyzers/its/expected/Ember-MM/scraper.EmberCore.XML-{E567C031-1F7B-4637-9B3A-806988DE50CF}-S3900.json index d1cf7be0bc5..782c79bc7d8 100644 --- a/analyzers/its/expected/Ember-MM/scraper.EmberCore.XML-{E567C031-1F7B-4637-9B3A-806988DE50CF}-S3900.json +++ b/analyzers/its/expected/Ember-MM/scraper.EmberCore.XML-{E567C031-1F7B-4637-9B3A-806988DE50CF}-S3900.json @@ -977,19 +977,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'resultsEntity' before using it.", -"location": { -"uri": "sources\Ember-MM\Addons\scraper.EmberCore.XML\XMLScraper\ScraperXML\ScraperManager.vb", -"region": { -"startLine": 168, -"startColumn": 55, -"endLine": 168, -"endColumn": 68 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'element' before using it.", "location": { "uri": "sources\Ember-MM\Addons\scraper.EmberCore.XML\XMLScraper\Utilities\Extensions.vb", diff --git a/analyzers/its/expected/Nancy/Nancy--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy--net452-S3900.json index b11bcec6acb..3c67cce6792 100644 --- a/analyzers/its/expected/Nancy/Nancy--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy--net452-S3900.json @@ -67,19 +67,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'pipelineItem' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\AfterPipeline.cs", -"region": { -"startLine": 123, -"startColumn": 82, -"endLine": 123, -"endColumn": 94 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'item' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\AsyncNamedPipelineBase.cs", @@ -171,19 +158,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'pipelineItem' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\BeforePipeline.cs", -"region": { -"startLine": 138, -"startColumn": 92, -"endLine": 138, -"endColumn": 104 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'context' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Bootstrapper\NancyBootstrapperWithRequestContainerBase.cs", @@ -444,19 +418,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'requestedPath' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Conventions\StaticContentConventionBuilder.cs", -"region": { -"startLine": 36, -"startColumn": 18, -"endLine": 36, -"endColumn": 31 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'conventions' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Conventions\StaticContentsConventionsExtensions.cs", @@ -2394,19 +2355,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'options' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Owin\NancyMiddleware.cs", -"region": { -"startLine": 54, -"startColumn": 13, -"endLine": 54, -"endColumn": 20 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'nancyOptions' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Owin\NancyOptionsExtensions.cs", @@ -3031,19 +2979,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'capturedParameters' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Routing\Trie\Nodes\GreedyRegExCaptureNode.cs", -"region": { -"startLine": 66, -"startColumn": 21, -"endLine": 66, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'segments' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\Trie\Nodes\RootNode.cs", @@ -3707,19 +3642,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'assembly' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\ViewEngines\DefaultResourceReader.cs", -"region": { -"startLine": 23, -"startColumn": 38, -"endLine": 23, -"endColumn": 46 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'viewLocationResult' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\ViewEngines\DefaultViewCache.cs", diff --git a/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json b/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json index 3d69c32b42d..c45e1924fe8 100644 --- a/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json @@ -67,19 +67,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'pipelineItem' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\AfterPipeline.cs", -"region": { -"startLine": 123, -"startColumn": 82, -"endLine": 123, -"endColumn": 94 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'item' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\AsyncNamedPipelineBase.cs", @@ -171,19 +158,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'pipelineItem' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\BeforePipeline.cs", -"region": { -"startLine": 138, -"startColumn": 92, -"endLine": 138, -"endColumn": 104 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'context' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Bootstrapper\NancyBootstrapperWithRequestContainerBase.cs", @@ -444,19 +418,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'requestedPath' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Conventions\StaticContentConventionBuilder.cs", -"region": { -"startLine": 36, -"startColumn": 18, -"endLine": 36, -"endColumn": 31 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'conventions' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Conventions\StaticContentsConventionsExtensions.cs", @@ -2394,19 +2355,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'options' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Owin\NancyMiddleware.cs", -"region": { -"startLine": 54, -"startColumn": 13, -"endLine": 54, -"endColumn": 20 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'nancyOptions' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Owin\NancyOptionsExtensions.cs", @@ -3031,19 +2979,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'capturedParameters' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Routing\Trie\Nodes\GreedyRegExCaptureNode.cs", -"region": { -"startLine": 66, -"startColumn": 21, -"endLine": 66, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'segments' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\Trie\Nodes\RootNode.cs", @@ -3707,19 +3642,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'assembly' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\ViewEngines\DefaultResourceReader.cs", -"region": { -"startLine": 23, -"startColumn": 38, -"endLine": 23, -"endColumn": 46 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'viewLocationResult' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\ViewEngines\DefaultViewCache.cs", diff --git a/analyzers/its/expected/Nancy/Nancy.Embedded--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.Embedded--net452-S3900.json deleted file mode 100644 index 069d90f0dde..00000000000 --- a/analyzers/its/expected/Nancy/Nancy.Embedded--net452-S3900.json +++ /dev/null @@ -1,17 +0,0 @@ -{ -"issues": [ -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'requestedPath' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Embedded\Conventions\EmbeddedStaticContentConventionBuilder.cs", -"region": { -"startLine": 32, -"startColumn": 18, -"endLine": 32, -"endColumn": 31 -} -} -} -] -} diff --git a/analyzers/its/expected/Nancy/Nancy.Embedded--netstandard2.0-S3900.json b/analyzers/its/expected/Nancy/Nancy.Embedded--netstandard2.0-S3900.json deleted file mode 100644 index 069d90f0dde..00000000000 --- a/analyzers/its/expected/Nancy/Nancy.Embedded--netstandard2.0-S3900.json +++ /dev/null @@ -1,17 +0,0 @@ -{ -"issues": [ -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'requestedPath' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Embedded\Conventions\EmbeddedStaticContentConventionBuilder.cs", -"region": { -"startLine": 32, -"startColumn": 18, -"endLine": 32, -"endColumn": 31 -} -} -} -] -} diff --git a/analyzers/its/expected/Nancy/Nancy.Testing--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.Testing--net452-S3900.json index 71d8e8d63ae..accd75c4586 100644 --- a/analyzers/its/expected/Nancy/Nancy.Testing--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Testing--net452-S3900.json @@ -318,45 +318,6 @@ "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseExtensions.cs", "region": { -"startLine": 32, -"startColumn": 129, -"endLine": 32, -"endColumn": 137 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseExtensions.cs", -"region": { -"startLine": 35, -"startColumn": 18, -"endLine": 35, -"endColumn": 26 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseExtensions.cs", -"region": { -"startLine": 37, -"startColumn": 114, -"endLine": 37, -"endColumn": 122 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseExtensions.cs", -"region": { "startLine": 45, "startColumn": 17, "endLine": 45, diff --git a/analyzers/its/expected/Nancy/Nancy.Testing--netstandard2.0-S3900.json b/analyzers/its/expected/Nancy/Nancy.Testing--netstandard2.0-S3900.json index 71d8e8d63ae..accd75c4586 100644 --- a/analyzers/its/expected/Nancy/Nancy.Testing--netstandard2.0-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Testing--netstandard2.0-S3900.json @@ -318,45 +318,6 @@ "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseExtensions.cs", "region": { -"startLine": 32, -"startColumn": 129, -"endLine": 32, -"endColumn": 137 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseExtensions.cs", -"region": { -"startLine": 35, -"startColumn": 18, -"endLine": 35, -"endColumn": 26 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseExtensions.cs", -"region": { -"startLine": 37, -"startColumn": 114, -"endLine": 37, -"endColumn": 122 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseExtensions.cs", -"region": { "startLine": 45, "startColumn": 17, "endLine": 45, diff --git a/analyzers/its/expected/Nancy/Nancy.ViewEngines.DotLiquid--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.ViewEngines.DotLiquid--net452-S3900.json index 1130ea89979..90f6239c4ff 100644 --- a/analyzers/its/expected/Nancy/Nancy.ViewEngines.DotLiquid--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.ViewEngines.DotLiquid--net452-S3900.json @@ -2,45 +2,6 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'renderContext' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.ViewEngines.DotLiquid\DotLiquidViewEngine.cs", -"region": { -"startLine": 79, -"startColumn": 26, -"endLine": 79, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'renderContext' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.ViewEngines.DotLiquid\DotLiquidViewEngine.cs", -"region": { -"startLine": 90, -"startColumn": 47, -"endLine": 90, -"endColumn": 60 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'viewLocationResult' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.ViewEngines.DotLiquid\DotLiquidViewEngine.cs", -"region": { -"startLine": 104, -"startColumn": 50, -"endLine": 104, -"endColumn": 68 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'context' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.ViewEngines.DotLiquid\LiquidNancyFileSystem.cs", diff --git a/analyzers/its/expected/akka.net/Akka--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka--netstandard2.0-S3900.json index f2eac703232..e2b293f229e 100644 --- a/analyzers/its/expected/akka.net/Akka--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka--netstandard2.0-S3900.json @@ -106,19 +106,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'watcher' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Actor\ActorCell.DeathWatch.cs", -"region": { -"startLine": 230, -"startColumn": 31, -"endLine": 230, -"endColumn": 38 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'watchee' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorCell.DeathWatch.cs", @@ -132,19 +119,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'watcher' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Actor\ActorCell.DeathWatch.cs", -"region": { -"startLine": 259, -"startColumn": 31, -"endLine": 259, -"endColumn": 38 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'parentPath' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorPath.cs", @@ -821,19 +795,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'target' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Actor\GracefulStopSupport.cs", -"region": { -"startLine": 65, -"startColumn": 13, -"endLine": 65, -"endColumn": 19 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'system' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Inbox.cs", @@ -860,19 +821,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'extension' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Actor\Internal\ActorSystemImpl.cs", -"region": { -"startLine": 338, -"startColumn": 34, -"endLine": 338, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'extensionId' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Internal\ActorSystemImpl.cs", @@ -2238,19 +2186,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'value' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Pattern\FutureTimeoutSupport.cs", -"region": { -"startLine": 39, -"startColumn": 28, -"endLine": 39, -"endColumn": 33 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'scheduler' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Pattern\FutureTimeoutSupport.cs", @@ -2303,19 +2238,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'node' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Routing\ConsistentHash.cs", -"region": { -"startLine": 176, -"startColumn": 51, -"endLine": 176, -"endColumn": 55 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'hash' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Routing\ConsistentHash.cs", @@ -2329,19 +2251,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'node' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Routing\ConsistentHash.cs", -"region": { -"startLine": 192, -"startColumn": 51, -"endLine": 192, -"endColumn": 55 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'hash' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Routing\ConsistentHash.cs", @@ -2680,19 +2589,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Serialization\NewtonSoftJsonSerializer.cs", -"region": { -"startLine": 162, -"startColumn": 37, -"endLine": 162, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'msg' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", @@ -2710,58 +2606,6 @@ "location": { "uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", "region": { -"startLine": 162, -"startColumn": 37, -"endLine": 162, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", -"region": { -"startLine": 175, -"startColumn": 21, -"endLine": 175, -"endColumn": 27 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", -"region": { -"startLine": 204, -"startColumn": 21, -"endLine": 204, -"endColumn": 27 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", -"region": { -"startLine": 210, -"startColumn": 21, -"endLine": 210, -"endColumn": 27 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", -"region": { "startLine": 241, "startColumn": 24, "endLine": 241, diff --git a/analyzers/its/expected/akka.net/Akka.Cluster--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Cluster--netstandard2.0-S3900.json index cf3615e6399..cdb5cdac8d1 100644 --- a/analyzers/its/expected/akka.net/Akka.Cluster--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Cluster--netstandard2.0-S3900.json @@ -2,45 +2,6 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Cluster\Cluster.cs", -"region": { -"startLine": 116, -"startColumn": 44, -"endLine": 116, -"endColumn": 50 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Cluster\Cluster.cs", -"region": { -"startLine": 120, -"startColumn": 133, -"endLine": 120, -"endColumn": 139 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Cluster\Cluster.cs", -"region": { -"startLine": 138, -"startColumn": 31, -"endLine": 138, -"endColumn": 37 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'to' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\Cluster.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Cluster.Sharding--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Cluster.Sharding--netstandard2.0-S3900.json index d3bf6c15047..e5e6b92f5d8 100644 --- a/analyzers/its/expected/akka.net/Akka.Cluster.Sharding--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Cluster.Sharding--netstandard2.0-S3900.json @@ -197,32 +197,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'rebalanceInProgress' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ShardAllocationStrategy.cs", -"region": { -"startLine": 167, -"startColumn": 17, -"endLine": 167, -"endColumn": 36 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'rebalanceInProgress' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ShardAllocationStrategy.cs", -"region": { -"startLine": 182, -"startColumn": 57, -"endLine": 182, -"endColumn": 76 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'settings' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ShardedDaemonProcess.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Discovery--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Discovery--netstandard2.0-S3900.json index 6b25f91dcbb..e9b723caa05 100644 --- a/analyzers/its/expected/akka.net/Akka.Discovery--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Discovery--netstandard2.0-S3900.json @@ -28,19 +28,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Discovery\Config\ConfigServiceDiscovery.cs", -"region": { -"startLine": 23, -"startColumn": 20, -"endLine": 23, -"endColumn": 26 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'system' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Discovery\Config\ConfigServiceDiscovery.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Persistence--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Persistence--netstandard2.0-S3900.json index 2dd07fe6c5c..ec8355dbc1c 100644 --- a/analyzers/its/expected/akka.net/Akka.Persistence--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Persistence--netstandard2.0-S3900.json @@ -93,71 +93,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nextState' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Persistence\Fsm\PersistentFSM.cs", -"region": { -"startLine": 101, -"startColumn": 17, -"endLine": 101, -"endColumn": 26 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'nextState' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Persistence\Fsm\PersistentFSM.cs", -"region": { -"startLine": 103, -"startColumn": 45, -"endLine": 103, -"endColumn": 54 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'nextState' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Persistence\Fsm\PersistentFSM.cs", -"region": { -"startLine": 110, -"startColumn": 17, -"endLine": 110, -"endColumn": 26 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'nextState' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Persistence\Fsm\PersistentFSM.cs", -"region": { -"startLine": 110, -"startColumn": 39, -"endLine": 110, -"endColumn": 48 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'nextState' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Persistence\Fsm\PersistentFSM.cs", -"region": { -"startLine": 112, -"startColumn": 58, -"endLine": 112, -"endColumn": 67 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Fsm\PersistentFSM.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Persistence.Sql.Common--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Persistence.Sql.Common--netstandard2.0-S3900.json index 6f5d2306386..1045040b60e 100644 --- a/analyzers/its/expected/akka.net/Akka.Persistence.Sql.Common--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Persistence.Sql.Common--netstandard2.0-S3900.json @@ -223,19 +223,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'persistent' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\BatchingSqlJournal.cs", -"region": { -"startLine": 1299, -"startColumn": 31, -"endLine": 1299, -"endColumn": 41 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'reader' before using it.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\BatchingSqlJournal.cs", @@ -392,32 +379,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'replay' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\SqlJournal.cs", -"region": { -"startLine": 214, -"startColumn": 80, -"endLine": 214, -"endColumn": 86 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'replay' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\SqlJournal.cs", -"region": { -"startLine": 235, -"startColumn": 29, -"endLine": 235, -"endColumn": 35 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'config' before using it.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Settings.cs", @@ -448,19 +409,6 @@ "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Snapshot\QueryExecutor.cs", "region": { -"startLine": 338, -"startColumn": 32, -"endLine": 338, -"endColumn": 40 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'snapshot' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Snapshot\QueryExecutor.cs", -"region": { "startLine": 352, "startColumn": 32, "endLine": 352, diff --git a/analyzers/its/expected/akka.net/Akka.Serialization.Hyperion--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Serialization.Hyperion--netstandard2.0-S3900.json index 45282ba173f..59f518135ef 100644 --- a/analyzers/its/expected/akka.net/Akka.Serialization.Hyperion--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Serialization.Hyperion--netstandard2.0-S3900.json @@ -15,19 +15,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.Hyperion\HyperionSerializer.cs", -"region": { -"startLine": 75, -"startColumn": 37, -"endLine": 75, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'config' before using it.", "location": { "uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.Hyperion\HyperionSerializer.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Streams--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Streams--netstandard2.0-S3900.json index fb4a596258f..569ea990450 100644 --- a/analyzers/its/expected/akka.net/Akka.Streams--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Streams--netstandard2.0-S3900.json @@ -2459,32 +2459,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'materializer' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Stage\GraphStage.cs", -"region": { -"startLine": 2388, -"startColumn": 21, -"endLine": 2388, -"endColumn": 33 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'materializer' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Stage\GraphStage.cs", -"region": { -"startLine": 2392, -"startColumn": 107, -"endLine": 2392, -"endColumn": 119 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'context' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Stage\Stage.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Streams.TestKit--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Streams.TestKit--netstandard2.0-S3900.json index 5021580d7a3..c5ed0c6c72d 100644 --- a/analyzers/its/expected/akka.net/Akka.Streams.TestKit--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Streams.TestKit--netstandard2.0-S3900.json @@ -51,32 +51,6 @@ "endColumn": 26 } } -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'all' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams.TestKit\TestSubscriber.cs", -"region": { -"startLine": 262, -"startColumn": 35, -"endLine": 262, -"endColumn": 38 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'cause' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams.TestKit\TestSubscriber.cs", -"region": { -"startLine": 368, -"startColumn": 51, -"endLine": 368, -"endColumn": 56 -} -} } ] } diff --git a/analyzers/its/expected/akka.net/Akka.TestKit--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.TestKit--netstandard2.0-S3900.json index b1436bd9469..85768aeca7c 100644 --- a/analyzers/its/expected/akka.net/Akka.TestKit--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.TestKit--netstandard2.0-S3900.json @@ -67,32 +67,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'matchedEventHandler' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.TestKit\EventFilter\Internal\EventFilterApplier.cs", -"region": { -"startLine": 404, -"startColumn": 28, -"endLine": 404, -"endColumn": 47 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'matchedEventHandler' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.TestKit\EventFilter\Internal\EventFilterApplier.cs", -"region": { -"startLine": 427, -"startColumn": 28, -"endLine": 427, -"endColumn": 47 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 's' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.TestKit\EventFilter\Internal\StringMatcher\ContainsString.cs", diff --git a/analyzers/src/SonarAnalyzer.CFG/LiveVariableAnalysis/LiveVariableAnalysisBase.cs b/analyzers/src/SonarAnalyzer.CFG/LiveVariableAnalysis/LiveVariableAnalysisBase.cs index e1c263a0510..bb0af98bfae 100644 --- a/analyzers/src/SonarAnalyzer.CFG/LiveVariableAnalysis/LiveVariableAnalysisBase.cs +++ b/analyzers/src/SonarAnalyzer.CFG/LiveVariableAnalysis/LiveVariableAnalysisBase.cs @@ -28,7 +28,7 @@ public abstract class LiveVariableAnalysisBase protected readonly CancellationToken Cancel; private readonly IDictionary> blockLiveOut = new Dictionary>(); private readonly IDictionary> blockLiveIn = new Dictionary>(); - private readonly ISet captured = new HashSet(); + private readonly HashSet captured = new(); public abstract bool IsLocal(ISymbol symbol); protected abstract TBlock ExitBlock { get; } @@ -38,7 +38,7 @@ public abstract class LiveVariableAnalysisBase protected abstract IEnumerable Predecessors(TBlock block); public TCfg Cfg { get; } - public IReadOnlyCollection CapturedVariables => captured.ToImmutableArray(); + public IReadOnlyCollection CapturedVariables => captured; protected LiveVariableAnalysisBase(TCfg cfg, ISymbol originalDeclaration, CancellationToken cancel) { diff --git a/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/RoslynSymbolicExecution.cs b/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/RoslynSymbolicExecution.cs index be63a37b2c5..180ef69dd44 100644 --- a/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/RoslynSymbolicExecution.cs +++ b/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/RoslynSymbolicExecution.cs @@ -92,7 +92,7 @@ private IEnumerable ProcessBranching(ExplodedNode node) if (node.Block.Kind == BasicBlockKind.Exit) { logger.Log(node.State, "Exit Reached"); - checks.ExitReached(new(null, node.State)); + checks.ExitReached(new(null, node.State, lva.CapturedVariables)); } else if (node.Block.Successors.Length == 1 && ThrownException(node, node.Block.Successors.Single().Semantics) is { } exception) { @@ -146,7 +146,7 @@ private ProgramState ProcessBranchState(ControlFlowBranch branch, ProgramState s if (branch.Source.BranchValue is { } branchValue && branch.Source.ConditionalSuccessor is not null) // This branching was conditional { state = SetBranchingConstraints(branch, state, branchValue); - state = checks.ConditionEvaluated(new(branchValue.ToSonar(), state)); + state = checks.ConditionEvaluated(new(branchValue.ToSonar(), state, lva.CapturedVariables)); if (state is null) { return null; @@ -169,7 +169,7 @@ private ProgramState ProcessBranchState(ControlFlowBranch branch, ProgramState s private IEnumerable ProcessOperation(ExplodedNode node) { - foreach (var preProcessed in checks.PreProcess(new(node.Operation, node.State))) + foreach (var preProcessed in checks.PreProcess(new(node.Operation, node.State, lva.CapturedVariables))) { foreach (var processed in OperationDispatcher.Process(preProcessed)) { diff --git a/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/RuleChecks/PublicMethodArgumentsShouldBeCheckedForNullBase.cs b/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/RuleChecks/PublicMethodArgumentsShouldBeCheckedForNullBase.cs index ba1b663af1d..e21b231d05c 100644 --- a/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/RuleChecks/PublicMethodArgumentsShouldBeCheckedForNullBase.cs +++ b/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/RuleChecks/PublicMethodArgumentsShouldBeCheckedForNullBase.cs @@ -34,10 +34,10 @@ protected override ProgramState PreProcessSimple(SymbolicContext context) { if (NullDereferenceCandidate(context.Operation.Instance) is { } candidate && candidate.Kind == OperationKindEx.ParameterReference - && candidate.ToParameterReference() is var parameterReference - && !parameterReference.Parameter.Type.IsValueType - && !HasObjectConstraint(parameterReference.Parameter) - && !parameterReference.Parameter.HasAttribute(KnownType.Microsoft_AspNetCore_Mvc_FromServicesAttribute)) + && candidate.ToParameterReference() is { Parameter: { Type.IsValueType: false } parameter } parameterReference + && !HasObjectConstraint(parameter) + && !context.CapturedVariables.Contains(parameter) // Workaround to avoid FPs. Can be removed once captures are properly handled by lva.LiveOut() + && !parameter.HasAttribute(KnownType.Microsoft_AspNetCore_Mvc_FromServicesAttribute)) { var message = IsInConstructorInitializer(context.Operation.Instance.Syntax) ? "Refactor this constructor to avoid using members of parameter '{0}' because it could be {1}." diff --git a/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/SymbolicContext.cs b/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/SymbolicContext.cs index 1e17f755640..faaea1cb0cb 100644 --- a/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/SymbolicContext.cs +++ b/analyzers/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/SymbolicContext.cs @@ -24,11 +24,13 @@ public class SymbolicContext { public IOperationWrapperSonar Operation { get; } public ProgramState State { get; } + public IReadOnlyCollection CapturedVariables { get; } - public SymbolicContext(IOperationWrapperSonar operation, ProgramState state) + public SymbolicContext(IOperationWrapperSonar operation, ProgramState state, IReadOnlyCollection capturedVariables) { Operation = operation; // Operation can be null for the branch nodes. State = state ?? throw new ArgumentNullException(nameof(state)); + CapturedVariables = capturedVariables ?? throw new ArgumentNullException(nameof(capturedVariables)); } public ProgramState SetOperationConstraint(SymbolicConstraint constraint) => @@ -38,7 +40,7 @@ public ProgramState SetSymbolConstraint(ISymbol symbol, SymbolicConstraint const State.SetSymbolConstraint(symbol, constraint); public SymbolicContext WithState(ProgramState newState) => - State == newState ? this : new(Operation, newState); + State == newState ? this : new(Operation, newState, CapturedVariables); public bool HasConstraint(IOperation operation, SymbolicConstraint constraint) => State[operation]?.HasConstraint(constraint) is true; diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/SymbolicCheckListTest.cs b/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/SymbolicCheckListTest.cs index 811399f61e4..cee04642f0f 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/SymbolicCheckListTest.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/SymbolicCheckListTest.cs @@ -36,7 +36,7 @@ public void Notifications_ExecutedForAll() { var a = new Mock(); var b = new Mock(); - var context = new SymbolicContext(null, ProgramState.Empty); + var context = new SymbolicContext(null, ProgramState.Empty, Array.Empty()); a.Setup(x => x.PreProcess(context)).Returns(new[] { context.State }); a.Setup(x => x.PostProcess(context)).Returns(new[] { context.State }); var sut = new SymbolicCheckList(new[] { a.Object, b.Object }); @@ -71,7 +71,7 @@ public void PostProcess_CanReturnMultipleStates() { var triple = new PostProcessTestCheck(x => new[] { x.State, x.State, x.State }); var sut = new SymbolicCheckList(new[] { triple, triple }); - sut.PostProcess(new(null, ProgramState.Empty)).Should().HaveCount(9); + sut.PostProcess(new(null, ProgramState.Empty, Array.Empty())).Should().HaveCount(9); } [TestMethod] @@ -79,7 +79,7 @@ public void PostProcess_CanReturnNoStates() { var empty = new PostProcessTestCheck(x => Array.Empty()); var sut = new SymbolicCheckList(new[] { empty }); - sut.PostProcess(new(null, ProgramState.Empty)).Should().HaveCount(0); + sut.PostProcess(new(null, ProgramState.Empty, Array.Empty())).Should().HaveCount(0); } } } diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/SymbolicContextTest.cs b/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/SymbolicContextTest.cs index 71c4a85639c..4dd879b91c0 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/SymbolicContextTest.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/SymbolicContextTest.cs @@ -29,15 +29,22 @@ namespace SonarAnalyzer.UnitTest.SymbolicExecution.Roslyn public class SymbolicContextTest { [TestMethod] - public void NullArgument_Throws() + public void NullArgument_State_Throws() { - var operation = CreateOperation(); - ((Func)(() => new SymbolicContext(operation, null))).Should().Throw().And.ParamName.Should().Be("state"); + var create = () => new SymbolicContext(CreateOperation(), null, Array.Empty()); + create.Should().Throw().And.ParamName.Should().Be("state"); + } + + [TestMethod] + public void NullArgument_CapturedVariables_Throws() + { + var create = () => new SymbolicContext(CreateOperation(), ProgramState.Empty, null); + create.Should().Throw().And.ParamName.Should().Be("capturedVariables"); } [TestMethod] public void NullOperation_SetsOperationToNull() => - new SymbolicContext(null, ProgramState.Empty).Operation.Should().Be(null); + new SymbolicContext(null, ProgramState.Empty, Array.Empty()).Operation.Should().Be(null); [TestMethod] public void PropertiesArePersisted() @@ -45,7 +52,7 @@ public void PropertiesArePersisted() var operation = CreateOperation(); var state = ProgramState.Empty.SetOperationValue(operation, SymbolicValue.Empty); - var sut = new SymbolicContext(operation, state); + var sut = new SymbolicContext(operation, state, Array.Empty()); sut.Operation.Should().Be(operation); sut.State.Should().Be(state); } @@ -56,7 +63,7 @@ public void SetOperationConstraint_WithExistingValue() var operation = CreateOperation(); var state = ProgramState.Empty.SetOperationValue(operation, SymbolicValue.Empty); - var sut = new SymbolicContext(operation, state); + var sut = new SymbolicContext(operation, state, Array.Empty()); var result = sut.SetOperationConstraint(DummyConstraint.Dummy); result.Should().NotBe(state, "new ProgramState instance should be created"); result[operation].HasConstraint(DummyConstraint.Dummy).Should().BeTrue(); @@ -68,7 +75,7 @@ public void SetOperationConstraint_WithNewValue() var operation = CreateOperation(); var state = ProgramState.Empty; - var sut = new SymbolicContext(operation, state); + var sut = new SymbolicContext(operation, state, Array.Empty()); var result = sut.SetOperationConstraint(DummyConstraint.Dummy); result.Should().NotBe(state, "new ProgramState instance should be created"); result[operation].HasConstraint(DummyConstraint.Dummy).Should().BeTrue(); @@ -81,7 +88,7 @@ public void SetSymbolConstraint_WithExistingValue() var symbol = operation.Children.First().TrackedSymbol(); var state = ProgramState.Empty.SetSymbolValue(symbol, SymbolicValue.Empty); - var sut = new SymbolicContext(operation, state); + var sut = new SymbolicContext(operation, state, Array.Empty()); var result = sut.SetSymbolConstraint(symbol, DummyConstraint.Dummy); result.Should().NotBe(state, "new ProgramState instance should be created"); result[symbol].HasConstraint(DummyConstraint.Dummy).Should().BeTrue(); @@ -94,7 +101,7 @@ public void SetSymbolConstraint_WithNewValue() var symbol = operation.Children.First().TrackedSymbol(); var state = ProgramState.Empty; - var sut = new SymbolicContext(operation, state); + var sut = new SymbolicContext(operation, state, Array.Empty()); var result = sut.SetSymbolConstraint(symbol, DummyConstraint.Dummy); result.Should().NotBe(state, "new ProgramState instance should be created"); result[symbol].HasConstraint(DummyConstraint.Dummy).Should().BeTrue(); @@ -104,7 +111,7 @@ public void SetSymbolConstraint_WithNewValue() public void WithState_SameState_ReturnsThis() { var state = ProgramState.Empty; - var sut = new SymbolicContext(null, state); + var sut = new SymbolicContext(null, state, Array.Empty()); sut.WithState(state).Should().Be(sut); } @@ -112,7 +119,7 @@ public void WithState_SameState_ReturnsThis() public void WithState_DifferentState_ReturnsNew() { var state = ProgramState.Empty; - var sut = new SymbolicContext(null, state); + var sut = new SymbolicContext(null, state, Array.Empty()); var newState = state.SetOperationValue(CreateOperation(), SymbolicValue.Empty); sut.WithState(newState).Should().NotBe(sut); } diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs index 08470aa4570..cf6665d3e06 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text; using System.Threading.Tasks; @@ -783,7 +784,7 @@ public class Sample { } public class ParameterCaptures { - public string InsideLambda(string s) + public string InsideLambda_CaptureAfterCheck(string s) { if (s == null) { @@ -792,6 +793,31 @@ public string InsideLambda(string s) Func someFunc = () => s.ToString(); - return s.ToString(); // Noncompliant FP + return s.ToString(); // Compliant + } + + public string InsideLambda_CaptureBeforeDereference(string s) + { + Func someFunc = () => s.ToString(); + + return s.ToString(); // FN: s is not checked here + } + + public void CapturedInLinq_WithCheckBefore(string s, List list) + { + if (s == null) + { + return; + } + s.ToString(); // Compliant + + list.Where(x => x == s); + } + + public void CapturedInLinq_WithNoCheck(string s, List list) + { + s.ToString(); // FN + + list.Where(x => x == s); } } diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.vb b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.vb index 86d0b55f2dd..a379670248b 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.vb +++ b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.vb @@ -528,10 +528,10 @@ Public Class Nancy_Repros Sub WithCapture(Ex As Exception, Condition As Boolean) Dim F As Func(Of Object) = Function() Ex ' LVA tracks capturing of this parameter Dim Value As Object - Value = Ex.Message ' Noncompliant + Value = Ex.Message ' FN + Value = Ex.Message + Value = If(Condition, Ex.Message, "") Value = Ex.Message - Value = If(Condition, Ex.Message, "") ' Noncompliant FP - Value = Ex.Message ' Noncompliant FP End Sub End Class