diff --git a/analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json b/analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json index 59471a3d564..4d1cf7e3eef 100644 --- a/analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json +++ b/analyzers/its/expected/Automapper/AutoMapper--net461-S3900.json @@ -223,7 +223,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'expression' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'expression' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Configuration\ConfigurationValidator.cs", "region": { @@ -392,14 +392,14 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'enumerableOfProfiles' before using it.", +"message": "Refactor this method to add validation of parameter 'memberOptions' before using it.", "location": { -"uri": "sources\Automapper\src\AutoMapper\Configuration\MapperConfigurationExpression.cs", +"uri": "sources\Automapper\src\AutoMapper\Configuration\MappingExpression.cs", "region": { -"startLine": 161, -"startColumn": 37, -"endLine": 161, -"endColumn": 57 +"startLine": 169, +"startColumn": 13, +"endLine": 169, +"endColumn": 26 } } }, @@ -457,19 +457,6 @@ }, { "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", @@ -485,25 +472,25 @@ "id": "S3900", "message": "Refactor this method to add validation of parameter 'typeMap' before using it.", "location": { -"uri": "sources\Automapper\src\AutoMapper\Configuration\MemberConfigurationExpression.cs", +"uri": "sources\Automapper\src\AutoMapper\Configuration\PathConfigurationExpression.cs", "region": { -"startLine": 327, -"startColumn": 31, -"endLine": 327, -"endColumn": 38 +"startLine": 71, +"startColumn": 27, +"endLine": 71, +"endColumn": 34 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'typeMap' before using it.", +"message": "Refactor this method to add validation of parameter 'type' before using it.", "location": { -"uri": "sources\Automapper\src\AutoMapper\Configuration\PathConfigurationExpression.cs", +"uri": "sources\Automapper\src\AutoMapper\Configuration\Profile.cs", "region": { -"startLine": 71, -"startColumn": 27, -"endLine": 71, -"endColumn": 34 +"startLine": 189, +"startColumn": 17, +"endLine": 189, +"endColumn": 21 } } }, @@ -626,19 +613,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'members' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", -"region": { -"startLine": 170, -"startColumn": 36, -"endLine": 170, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'lambda' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", @@ -678,19 +652,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'members' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", -"region": { -"startLine": 232, -"startColumn": 36, -"endLine": 232, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'collection' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", @@ -773,6 +734,32 @@ "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", "region": { +"startLine": 333, +"startColumn": 77, +"endLine": 333, +"endColumn": 87 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'expression' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", +"region": { +"startLine": 334, +"startColumn": 35, +"endLine": 334, +"endColumn": 45 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'expression' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", +"region": { "startLine": 365, "startColumn": 111, "endLine": 365, @@ -808,7 +795,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'property' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'property' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\ProxyGenerator.cs", "region": { @@ -821,7 +808,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'typeMap' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'typeMap' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\TypeMapPlanBuilder.cs", "region": { @@ -977,6 +964,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'parameter' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\Internal\ReflectionHelper.cs", +"region": { +"startLine": 19, +"startColumn": 119, +"endLine": 19, +"endColumn": 128 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'context' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Internal\ReflectionHelper.cs", @@ -1029,19 +1029,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'prefixes' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\Internal\TypeDetails.cs", -"region": { -"startLine": 75, -"startColumn": 36, -"endLine": 75, -"endColumn": 44 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'memberName' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Internal\TypeDetails.cs", @@ -1055,7 +1042,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'constructor' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'constructor' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Internal\TypeDetails.cs", "region": { @@ -1111,6 +1098,19 @@ "location": { "uri": "sources\Automapper\src\AutoMapper\Internal\TypeExtensions.cs", "region": { +"startLine": 43, +"startColumn": 43, +"endLine": 43, +"endColumn": 47 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'type' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\Internal\TypeExtensions.cs", +"region": { "startLine": 49, "startColumn": 89, "endLine": 49, @@ -1224,7 +1224,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'destination' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'destination' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Mappers\CollectionMapper.cs", "region": { @@ -1486,6 +1486,19 @@ "id": "S3900", "message": "Refactor this method to add validation of parameter 'destExpression' before using it.", "location": { +"uri": "sources\Automapper\src\AutoMapper\Mappers\StringToEnumMapper.cs", +"region": { +"startLine": 19, +"startColumn": 35, +"endLine": 19, +"endColumn": 49 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'destExpression' before using it.", +"location": { "uri": "sources\Automapper\src\AutoMapper\Mappers\ToDynamicMapper.cs", "region": { "startLine": 48, @@ -1549,7 +1562,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'includedMember' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'includedMember' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\PathMap.cs", "region": { @@ -1562,6 +1575,19 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'profile' because it could be null.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\ProfileMap.cs", +"region": { +"startLine": 28, +"startColumn": 20, +"endLine": 28, +"endColumn": 27 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'openMapConfig' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\ProfileMap.cs", @@ -1627,7 +1653,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'includedMember' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'includedMember' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", "region": { @@ -1640,7 +1666,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'includedMemberMap' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'includedMemberMap' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", "region": { @@ -1653,6 +1679,123 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 70, +"startColumn": 21, +"endLine": 70, +"endColumn": 44 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 91, +"startColumn": 27, +"endLine": 91, +"endColumn": 50 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 92, +"startColumn": 27, +"endLine": 92, +"endColumn": 50 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 93, +"startColumn": 30, +"endLine": 93, +"endColumn": 53 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 94, +"startColumn": 32, +"endLine": 94, +"endColumn": 55 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 95, +"startColumn": 30, +"endLine": 95, +"endColumn": 53 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 96, +"startColumn": 37, +"endLine": 96, +"endColumn": 60 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 97, +"startColumn": 35, +"endLine": 97, +"endColumn": 58 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 98, +"startColumn": 17, +"endLine": 98, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'memberMap' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\AssignableProjectionMapper.cs", @@ -1783,6 +1926,45 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'configuration' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\MappedTypeProjectionMapper.cs", +"region": { +"startLine": 15, +"startColumn": 41, +"endLine": 15, +"endColumn": 54 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'memberMap' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\MappedTypeProjectionMapper.cs", +"region": { +"startLine": 21, +"startColumn": 17, +"endLine": 21, +"endColumn": 26 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'resolvedSource' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\MappedTypeProjectionMapper.cs", +"region": { +"startLine": 21, +"startColumn": 106, +"endLine": 21, +"endColumn": 120 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'letPropertyMaps' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\ProjectionBuilder.cs", @@ -1913,6 +2095,32 @@ }, { "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", @@ -1965,6 +2173,19 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'profile' because it could be null.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\TypeMap.cs", +"region": { +"startLine": 39, +"startColumn": 33, +"endLine": 39, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'type' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\TypeMap.cs", @@ -1975,6 +2196,19 @@ "endColumn": 55 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'destinationProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\TypeMap.cs", +"region": { +"startLine": 210, +"startColumn": 46, +"endLine": 210, +"endColumn": 65 +} +} } ] } diff --git a/analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json b/analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json index 59471a3d564..4d1cf7e3eef 100644 --- a/analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json +++ b/analyzers/its/expected/Automapper/AutoMapper--netstandard2.0-S3900.json @@ -223,7 +223,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'expression' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'expression' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Configuration\ConfigurationValidator.cs", "region": { @@ -392,14 +392,14 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'enumerableOfProfiles' before using it.", +"message": "Refactor this method to add validation of parameter 'memberOptions' before using it.", "location": { -"uri": "sources\Automapper\src\AutoMapper\Configuration\MapperConfigurationExpression.cs", +"uri": "sources\Automapper\src\AutoMapper\Configuration\MappingExpression.cs", "region": { -"startLine": 161, -"startColumn": 37, -"endLine": 161, -"endColumn": 57 +"startLine": 169, +"startColumn": 13, +"endLine": 169, +"endColumn": 26 } } }, @@ -457,19 +457,6 @@ }, { "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", @@ -485,25 +472,25 @@ "id": "S3900", "message": "Refactor this method to add validation of parameter 'typeMap' before using it.", "location": { -"uri": "sources\Automapper\src\AutoMapper\Configuration\MemberConfigurationExpression.cs", +"uri": "sources\Automapper\src\AutoMapper\Configuration\PathConfigurationExpression.cs", "region": { -"startLine": 327, -"startColumn": 31, -"endLine": 327, -"endColumn": 38 +"startLine": 71, +"startColumn": 27, +"endLine": 71, +"endColumn": 34 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'typeMap' before using it.", +"message": "Refactor this method to add validation of parameter 'type' before using it.", "location": { -"uri": "sources\Automapper\src\AutoMapper\Configuration\PathConfigurationExpression.cs", +"uri": "sources\Automapper\src\AutoMapper\Configuration\Profile.cs", "region": { -"startLine": 71, -"startColumn": 27, -"endLine": 71, -"endColumn": 34 +"startLine": 189, +"startColumn": 17, +"endLine": 189, +"endColumn": 21 } } }, @@ -626,19 +613,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'members' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", -"region": { -"startLine": 170, -"startColumn": 36, -"endLine": 170, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'lambda' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", @@ -678,19 +652,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'members' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", -"region": { -"startLine": 232, -"startColumn": 36, -"endLine": 232, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'collection' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", @@ -773,6 +734,32 @@ "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", "region": { +"startLine": 333, +"startColumn": 77, +"endLine": 333, +"endColumn": 87 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'expression' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", +"region": { +"startLine": 334, +"startColumn": 35, +"endLine": 334, +"endColumn": 45 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'expression' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\Execution\ExpressionBuilder.cs", +"region": { "startLine": 365, "startColumn": 111, "endLine": 365, @@ -808,7 +795,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'property' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'property' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\ProxyGenerator.cs", "region": { @@ -821,7 +808,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'typeMap' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'typeMap' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Execution\TypeMapPlanBuilder.cs", "region": { @@ -977,6 +964,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'parameter' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\Internal\ReflectionHelper.cs", +"region": { +"startLine": 19, +"startColumn": 119, +"endLine": 19, +"endColumn": 128 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'context' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Internal\ReflectionHelper.cs", @@ -1029,19 +1029,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'prefixes' before using it.", -"location": { -"uri": "sources\Automapper\src\AutoMapper\Internal\TypeDetails.cs", -"region": { -"startLine": 75, -"startColumn": 36, -"endLine": 75, -"endColumn": 44 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'memberName' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\Internal\TypeDetails.cs", @@ -1055,7 +1042,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'constructor' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'constructor' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Internal\TypeDetails.cs", "region": { @@ -1111,6 +1098,19 @@ "location": { "uri": "sources\Automapper\src\AutoMapper\Internal\TypeExtensions.cs", "region": { +"startLine": 43, +"startColumn": 43, +"endLine": 43, +"endColumn": 47 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'type' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\Internal\TypeExtensions.cs", +"region": { "startLine": 49, "startColumn": 89, "endLine": 49, @@ -1224,7 +1224,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'destination' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'destination' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\Mappers\CollectionMapper.cs", "region": { @@ -1486,6 +1486,19 @@ "id": "S3900", "message": "Refactor this method to add validation of parameter 'destExpression' before using it.", "location": { +"uri": "sources\Automapper\src\AutoMapper\Mappers\StringToEnumMapper.cs", +"region": { +"startLine": 19, +"startColumn": 35, +"endLine": 19, +"endColumn": 49 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'destExpression' before using it.", +"location": { "uri": "sources\Automapper\src\AutoMapper\Mappers\ToDynamicMapper.cs", "region": { "startLine": 48, @@ -1549,7 +1562,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'includedMember' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'includedMember' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\PathMap.cs", "region": { @@ -1562,6 +1575,19 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'profile' because it could be null.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\ProfileMap.cs", +"region": { +"startLine": 28, +"startColumn": 20, +"endLine": 28, +"endColumn": 27 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'openMapConfig' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\ProfileMap.cs", @@ -1627,7 +1653,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'includedMember' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'includedMember' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", "region": { @@ -1640,7 +1666,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'includedMemberMap' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'includedMemberMap' because it could be null.", "location": { "uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", "region": { @@ -1653,6 +1679,123 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 70, +"startColumn": 21, +"endLine": 70, +"endColumn": 44 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 91, +"startColumn": 27, +"endLine": 91, +"endColumn": 50 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 92, +"startColumn": 27, +"endLine": 92, +"endColumn": 50 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 93, +"startColumn": 30, +"endLine": 93, +"endColumn": 53 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 94, +"startColumn": 32, +"endLine": 94, +"endColumn": 55 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 95, +"startColumn": 30, +"endLine": 95, +"endColumn": 53 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 96, +"startColumn": 37, +"endLine": 96, +"endColumn": 60 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 97, +"startColumn": 35, +"endLine": 97, +"endColumn": 58 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'inheritedMappedProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\PropertyMap.cs", +"region": { +"startLine": 98, +"startColumn": 17, +"endLine": 98, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'memberMap' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\AssignableProjectionMapper.cs", @@ -1783,6 +1926,45 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'configuration' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\MappedTypeProjectionMapper.cs", +"region": { +"startLine": 15, +"startColumn": 41, +"endLine": 15, +"endColumn": 54 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'memberMap' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\MappedTypeProjectionMapper.cs", +"region": { +"startLine": 21, +"startColumn": 17, +"endLine": 21, +"endColumn": 26 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'resolvedSource' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\MappedTypeProjectionMapper.cs", +"region": { +"startLine": 21, +"startColumn": 106, +"endLine": 21, +"endColumn": 120 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'letPropertyMaps' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\QueryableExtensions\ProjectionBuilder.cs", @@ -1913,6 +2095,32 @@ }, { "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", @@ -1965,6 +2173,19 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'profile' because it could be null.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\TypeMap.cs", +"region": { +"startLine": 39, +"startColumn": 33, +"endLine": 39, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'type' before using it.", "location": { "uri": "sources\Automapper\src\AutoMapper\TypeMap.cs", @@ -1975,6 +2196,19 @@ "endColumn": 55 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'destinationProperty' before using it.", +"location": { +"uri": "sources\Automapper\src\AutoMapper\TypeMap.cs", +"region": { +"startLine": 210, +"startColumn": 46, +"endLine": 210, +"endColumn": 65 +} +} } ] } diff --git a/analyzers/its/expected/Ember-MM/Ember.Plugins-{9496C697-5AFD-4813-AEDC-AF33FACEADF0}-S3900.json b/analyzers/its/expected/Ember-MM/Ember.Plugins-{9496C697-5AFD-4813-AEDC-AF33FACEADF0}-S3900.json index 1cf45349508..bfa728a5ccb 100644 --- a/analyzers/its/expected/Ember-MM/Ember.Plugins-{9496C697-5AFD-4813-AEDC-AF33FACEADF0}-S3900.json +++ b/analyzers/its/expected/Ember-MM/Ember.Plugins-{9496C697-5AFD-4813-AEDC-AF33FACEADF0}-S3900.json @@ -2,6 +2,19 @@ "issues": [ { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Ember-MM\Ember.Plugins\PluginManager.cs", +"region": { +"startLine": 343, +"startColumn": 49, +"endLine": 343, +"endColumn": 54 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'section' before using it.", "location": { "uri": "sources\Ember-MM\Ember.Plugins\PluginSectionHandler.cs", diff --git a/analyzers/its/expected/Nancy/Nancy--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy--net452-S3900.json index 7c6f0cd8daf..cafb0ff6557 100644 --- a/analyzers/its/expected/Nancy/Nancy--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy--net452-S3900.json @@ -6,19 +6,6 @@ "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, @@ -67,6 +54,19 @@ }, { "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", @@ -97,19 +97,6 @@ "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, @@ -158,6 +145,19 @@ }, { "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", @@ -171,7 +171,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'pipelines' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'pipelines' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Bootstrapper\Pipelines.cs", "region": { @@ -418,6 +418,19 @@ }, { "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", @@ -444,7 +457,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'keyGenerator' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'keyGenerator' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Cryptography\AesEncryptionProvider.cs", "region": { @@ -457,7 +470,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'keyGenerator' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'keyGenerator' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Cryptography\DefaultHmacProvider.cs", "region": { @@ -522,7 +535,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'salt' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'salt' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Cryptography\PassphraseKeyGenerator.cs", "region": { @@ -561,19 +574,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'typeRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", -"region": { -"startLine": 109, -"startColumn": 46, -"endLine": 109, -"endColumn": 63 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", @@ -600,19 +600,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'collectionTypeRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", -"region": { -"startLine": 135, -"startColumn": 56, -"endLine": 135, -"endColumn": 83 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", @@ -639,19 +626,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'moduleRegistrationTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", -"region": { -"startLine": 160, -"startColumn": 52, -"endLine": 160, -"endColumn": 75 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", @@ -665,19 +639,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'instanceRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", -"region": { -"startLine": 177, -"startColumn": 50, -"endLine": 177, -"endColumn": 71 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", @@ -730,19 +691,6 @@ }, { "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", @@ -925,6 +873,71 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionary.cs", +"region": { +"startLine": 157, +"startColumn": 59, +"endLine": 157, +"endColumn": 64 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionary.cs", +"region": { +"startLine": 177, +"startColumn": 20, +"endLine": 177, +"endColumn": 23 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'dynamicValue' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionaryValue.cs", +"region": { +"startLine": 161, +"startColumn": 17, +"endLine": 161, +"endColumn": 29 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'compareValue' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionaryValue.cs", +"region": { +"startLine": 193, +"startColumn": 66, +"endLine": 193, +"endColumn": 78 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'compareValue' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionaryValue.cs", +"region": { +"startLine": 213, +"startColumn": 20, +"endLine": 213, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'binder' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DynamicDictionaryValue.cs", @@ -1228,19 +1241,6 @@ "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, @@ -1328,14 +1328,14 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'source' before using it.", +"message": "Refactor this method to add validation of parameter 'keySelector' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Extensions\CollectionExtensions.cs", "region": { -"startLine": 79, -"startColumn": 41, -"endLine": 79, -"endColumn": 47 +"startLine": 81, +"startColumn": 35, +"endLine": 81, +"endColumn": 46 } } }, @@ -1666,7 +1666,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'response' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\HeadResponse.cs", "region": { @@ -1731,6 +1731,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\HttpLink.cs", +"region": { +"startLine": 152, +"startColumn": 41, +"endLine": 152, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\HttpLinkRelation.cs", +"region": { +"startLine": 85, +"startColumn": 77, +"endLine": 85, +"endColumn": 82 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'type' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Json\Converters\TupleConverter.cs", @@ -1757,7 +1783,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'jsonConfiguration' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'jsonConfiguration' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Json\JavaScriptSerializer.cs", "region": { @@ -1770,7 +1796,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'jsonConfiguration' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'jsonConfiguration' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Json\JavaScriptSerializer.cs", "region": { @@ -2173,32 +2199,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'cookies' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\NegotiatorExtensions.cs", -"region": { -"startLine": 35, -"startColumn": 36, -"endLine": 35, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'headers' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\NegotiatorExtensions.cs", -"region": { -"startLine": 90, -"startColumn": 42, -"endLine": 90, -"endColumn": 49 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'negotiator' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\NegotiatorExtensions.cs", @@ -2316,6 +2316,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'action' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Owin\DelegateExtensions.cs", +"region": { +"startLine": 27, +"startColumn": 13, +"endLine": 27, +"endColumn": 19 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'context' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Owin\NancyContextExtensions.cs", @@ -2329,6 +2342,19 @@ }, { "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", @@ -2394,19 +2420,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'headers' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\ResponseExtensions.cs", -"region": { -"startLine": 138, -"startColumn": 42, -"endLine": 138, -"endColumn": 49 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'response' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\ResponseExtensions.cs", @@ -2459,7 +2472,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'context' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'context' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Responses\GenericFileResponse.cs", "region": { @@ -2472,7 +2485,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'sourceResponse' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'sourceResponse' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Responses\MaterialisingResponse.cs", "region": { @@ -2498,19 +2511,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'linkProcessors' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Responses\Negotiation\DefaultResponseNegotiator.cs", -"region": { -"startLine": 377, -"startColumn": 43, -"endLine": 377, -"endColumn": 57 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Responses\Negotiation\MediaRange.cs", @@ -2762,6 +2762,19 @@ "location": { "uri": "sources\Nancy\src\Nancy\Routing\Constraints\ParameterizedRouteSegmentConstraintBase.cs", "region": { +"startLine": 21, +"startColumn": 113, +"endLine": 21, +"endColumn": 123 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'constraint' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Routing\Constraints\ParameterizedRouteSegmentConstraintBase.cs", +"region": { "startLine": 35, "startColumn": 30, "endLine": 35, @@ -2771,6 +2784,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'constraint' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Routing\Constraints\ParameterizedRouteSegmentConstraintBase.cs", +"region": { +"startLine": 35, +"startColumn": 51, +"endLine": 35, +"endColumn": 61 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'parameters' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\Constraints\RangeRouteSegmentConstraint.cs", @@ -2875,7 +2901,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'contextFactory' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'contextFactory' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\RouteCache.cs", "region": { @@ -2888,7 +2914,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'moduleCatalog' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'moduleCatalog' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\RouteCache.cs", "region": { @@ -2953,6 +2979,19 @@ }, { "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", @@ -3018,45 +3057,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'localCaptures' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Routing\Trie\Nodes\TrieNode.cs", -"region": { -"startLine": 224, -"startColumn": 46, -"endLine": 224, -"endColumn": 59 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'localCaptures' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Routing\Trie\Nodes\TrieNode.cs", -"region": { -"startLine": 249, -"startColumn": 48, -"endLine": 249, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'cache' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Routing\Trie\RouteResolverTrie.cs", -"region": { -"startLine": 35, -"startColumn": 39, -"endLine": 35, -"endColumn": 44 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'path' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\Trie\RouteResolverTrie.cs", @@ -3083,6 +3083,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'isValid' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Security\ClaimsPrincipalExtensions.cs", +"region": { +"startLine": 57, +"startColumn": 20, +"endLine": 57, +"endColumn": 27 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'pipelines' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Security\Csrf.cs", @@ -3135,6 +3148,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Security\CsrfToken.cs", +"region": { +"startLine": 46, +"startColumn": 51, +"endLine": 46, +"endColumn": 56 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Security\CsrfToken.cs", +"region": { +"startLine": 62, +"startColumn": 17, +"endLine": 62, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'token' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Security\CsrfTokenExtensions.cs", @@ -3187,7 +3226,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'cryptoConfig' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'cryptoConfig' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Security\DefaultCsrfTokenValidator.cs", "region": { @@ -3590,7 +3629,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'viewLocationContext' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'viewLocationContext' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\ViewEngines\DefaultRenderContext.cs", "region": { @@ -3603,6 +3642,19 @@ }, { "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", @@ -3616,7 +3668,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'rootPathProvider' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'rootPathProvider' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\ViewEngines\FileSystemViewLocationProvider.cs", "region": { @@ -3626,6 +3678,32 @@ "endColumn": 45 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\ViewEngines\ViewLocationResult.cs", +"region": { +"startLine": 79, +"startColumn": 27, +"endLine": 79, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\ViewEngines\ViewLocationResult.cs", +"region": { +"startLine": 91, +"startColumn": 20, +"endLine": 91, +"endColumn": 23 +} +} } ] } diff --git a/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json b/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json index 4c26768e7ec..709e455d505 100644 --- a/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3900.json @@ -6,19 +6,6 @@ "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, @@ -67,6 +54,19 @@ }, { "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", @@ -97,19 +97,6 @@ "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, @@ -158,6 +145,19 @@ }, { "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", @@ -171,7 +171,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'pipelines' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'pipelines' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Bootstrapper\Pipelines.cs", "region": { @@ -418,6 +418,19 @@ }, { "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", @@ -444,7 +457,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'keyGenerator' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'keyGenerator' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Cryptography\AesEncryptionProvider.cs", "region": { @@ -457,7 +470,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'keyGenerator' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'keyGenerator' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Cryptography\DefaultHmacProvider.cs", "region": { @@ -522,7 +535,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'salt' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'salt' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Cryptography\PassphraseKeyGenerator.cs", "region": { @@ -561,19 +574,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'typeRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", -"region": { -"startLine": 109, -"startColumn": 46, -"endLine": 109, -"endColumn": 63 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", @@ -600,19 +600,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'collectionTypeRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", -"region": { -"startLine": 135, -"startColumn": 56, -"endLine": 135, -"endColumn": 83 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", @@ -639,19 +626,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'moduleRegistrationTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", -"region": { -"startLine": 160, -"startColumn": 52, -"endLine": 160, -"endColumn": 75 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", @@ -665,19 +639,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'instanceRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", -"region": { -"startLine": 177, -"startColumn": 50, -"endLine": 177, -"endColumn": 71 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DefaultNancyBootstrapper.cs", @@ -730,19 +691,6 @@ }, { "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", @@ -925,6 +873,71 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionary.cs", +"region": { +"startLine": 157, +"startColumn": 59, +"endLine": 157, +"endColumn": 64 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionary.cs", +"region": { +"startLine": 177, +"startColumn": 20, +"endLine": 177, +"endColumn": 23 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'dynamicValue' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionaryValue.cs", +"region": { +"startLine": 161, +"startColumn": 17, +"endLine": 161, +"endColumn": 29 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'compareValue' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionaryValue.cs", +"region": { +"startLine": 193, +"startColumn": 66, +"endLine": 193, +"endColumn": 78 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'compareValue' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\DynamicDictionaryValue.cs", +"region": { +"startLine": 213, +"startColumn": 20, +"endLine": 213, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'binder' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\DynamicDictionaryValue.cs", @@ -1228,19 +1241,6 @@ "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, @@ -1315,14 +1315,14 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'source' before using it.", +"message": "Refactor this method to add validation of parameter 'keySelector' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Extensions\CollectionExtensions.cs", "region": { -"startLine": 79, -"startColumn": 41, -"endLine": 79, -"endColumn": 47 +"startLine": 81, +"startColumn": 35, +"endLine": 81, +"endColumn": 46 } } }, @@ -1666,7 +1666,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'response' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\HeadResponse.cs", "region": { @@ -1731,6 +1731,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\HttpLink.cs", +"region": { +"startLine": 152, +"startColumn": 41, +"endLine": 152, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\HttpLinkRelation.cs", +"region": { +"startLine": 85, +"startColumn": 77, +"endLine": 85, +"endColumn": 82 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'type' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Json\Converters\TupleConverter.cs", @@ -1757,7 +1783,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'jsonConfiguration' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'jsonConfiguration' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Json\JavaScriptSerializer.cs", "region": { @@ -1770,7 +1796,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'jsonConfiguration' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'jsonConfiguration' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Json\JavaScriptSerializer.cs", "region": { @@ -2173,32 +2199,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'cookies' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\NegotiatorExtensions.cs", -"region": { -"startLine": 35, -"startColumn": 36, -"endLine": 35, -"endColumn": 43 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'headers' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\NegotiatorExtensions.cs", -"region": { -"startLine": 90, -"startColumn": 42, -"endLine": 90, -"endColumn": 49 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'negotiator' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\NegotiatorExtensions.cs", @@ -2316,6 +2316,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'action' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Owin\DelegateExtensions.cs", +"region": { +"startLine": 27, +"startColumn": 13, +"endLine": 27, +"endColumn": 19 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'context' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Owin\NancyContextExtensions.cs", @@ -2329,6 +2342,19 @@ }, { "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", @@ -2394,19 +2420,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'headers' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\ResponseExtensions.cs", -"region": { -"startLine": 138, -"startColumn": 42, -"endLine": 138, -"endColumn": 49 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'response' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\ResponseExtensions.cs", @@ -2459,7 +2472,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'context' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'context' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Responses\GenericFileResponse.cs", "region": { @@ -2472,7 +2485,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'sourceResponse' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'sourceResponse' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Responses\MaterialisingResponse.cs", "region": { @@ -2498,19 +2511,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'linkProcessors' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Responses\Negotiation\DefaultResponseNegotiator.cs", -"region": { -"startLine": 377, -"startColumn": 43, -"endLine": 377, -"endColumn": 57 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Responses\Negotiation\MediaRange.cs", @@ -2762,6 +2762,19 @@ "location": { "uri": "sources\Nancy\src\Nancy\Routing\Constraints\ParameterizedRouteSegmentConstraintBase.cs", "region": { +"startLine": 21, +"startColumn": 113, +"endLine": 21, +"endColumn": 123 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'constraint' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Routing\Constraints\ParameterizedRouteSegmentConstraintBase.cs", +"region": { "startLine": 35, "startColumn": 30, "endLine": 35, @@ -2771,6 +2784,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'constraint' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Routing\Constraints\ParameterizedRouteSegmentConstraintBase.cs", +"region": { +"startLine": 35, +"startColumn": 51, +"endLine": 35, +"endColumn": 61 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'parameters' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\Constraints\RangeRouteSegmentConstraint.cs", @@ -2875,7 +2901,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'contextFactory' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'contextFactory' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\RouteCache.cs", "region": { @@ -2888,7 +2914,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'moduleCatalog' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'moduleCatalog' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\RouteCache.cs", "region": { @@ -2953,6 +2979,19 @@ }, { "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", @@ -3018,45 +3057,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'localCaptures' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Routing\Trie\Nodes\TrieNode.cs", -"region": { -"startLine": 224, -"startColumn": 46, -"endLine": 224, -"endColumn": 59 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'localCaptures' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Routing\Trie\Nodes\TrieNode.cs", -"region": { -"startLine": 249, -"startColumn": 48, -"endLine": 249, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'cache' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy\Routing\Trie\RouteResolverTrie.cs", -"region": { -"startLine": 35, -"startColumn": 39, -"endLine": 35, -"endColumn": 44 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'path' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Routing\Trie\RouteResolverTrie.cs", @@ -3083,6 +3083,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'isValid' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Security\ClaimsPrincipalExtensions.cs", +"region": { +"startLine": 57, +"startColumn": 20, +"endLine": 57, +"endColumn": 27 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'pipelines' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Security\Csrf.cs", @@ -3135,6 +3148,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Security\CsrfToken.cs", +"region": { +"startLine": 46, +"startColumn": 51, +"endLine": 46, +"endColumn": 56 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\Security\CsrfToken.cs", +"region": { +"startLine": 62, +"startColumn": 17, +"endLine": 62, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'token' before using it.", "location": { "uri": "sources\Nancy\src\Nancy\Security\CsrfTokenExtensions.cs", @@ -3187,7 +3226,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'cryptoConfig' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'cryptoConfig' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\Security\DefaultCsrfTokenValidator.cs", "region": { @@ -3590,7 +3629,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'viewLocationContext' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'viewLocationContext' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\ViewEngines\DefaultRenderContext.cs", "region": { @@ -3603,6 +3642,19 @@ }, { "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", @@ -3616,7 +3668,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'rootPathProvider' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'rootPathProvider' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy\ViewEngines\FileSystemViewLocationProvider.cs", "region": { @@ -3626,6 +3678,32 @@ "endColumn": 45 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\ViewEngines\ViewLocationResult.cs", +"region": { +"startLine": 79, +"startColumn": 27, +"endLine": 79, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy\ViewEngines\ViewLocationResult.cs", +"region": { +"startLine": 91, +"startColumn": 20, +"endLine": 91, +"endColumn": 23 +} +} } ] } diff --git a/analyzers/its/expected/Nancy/Nancy.Demo.Hosting.Kestrel--netcoreapp2.0-S3900.json b/analyzers/its/expected/Nancy/Nancy.Demo.Hosting.Kestrel--netcoreapp2.0-S3900.json index 8345e4456b4..3001f8c6038 100644 --- a/analyzers/its/expected/Nancy/Nancy.Demo.Hosting.Kestrel--netcoreapp2.0-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Demo.Hosting.Kestrel--netcoreapp2.0-S3900.json @@ -15,7 +15,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'env' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'env' because it could be null.", "location": { "uri": "sources\Nancy\samples\Nancy.Demo.Hosting.Kestrel\Startup.cs", "region": { diff --git a/analyzers/its/expected/Nancy/Nancy.Embedded--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.Embedded--net452-S3900.json new file mode 100644 index 00000000000..069d90f0dde --- /dev/null +++ b/analyzers/its/expected/Nancy/Nancy.Embedded--net452-S3900.json @@ -0,0 +1,17 @@ +{ +"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 new file mode 100644 index 00000000000..069d90f0dde --- /dev/null +++ b/analyzers/its/expected/Nancy/Nancy.Embedded--netstandard2.0-S3900.json @@ -0,0 +1,17 @@ +{ +"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.Hosting.Aspnet--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.Hosting.Aspnet--net452-S3900.json index 784caeb7da2..d0762fee2b4 100644 --- a/analyzers/its/expected/Nancy/Nancy.Hosting.Aspnet--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Hosting.Aspnet--net452-S3900.json @@ -67,19 +67,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'typeRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Hosting.Aspnet\DefaultNancyAspNetBootstrapper.cs", -"region": { -"startLine": 178, -"startColumn": 46, -"endLine": 178, -"endColumn": 63 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Hosting.Aspnet\DefaultNancyAspNetBootstrapper.cs", @@ -119,19 +106,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'collectionTypeRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Hosting.Aspnet\DefaultNancyAspNetBootstrapper.cs", -"region": { -"startLine": 205, -"startColumn": 56, -"endLine": 205, -"endColumn": 83 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Hosting.Aspnet\DefaultNancyAspNetBootstrapper.cs", @@ -171,19 +145,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'moduleRegistrationTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Hosting.Aspnet\DefaultNancyAspNetBootstrapper.cs", -"region": { -"startLine": 231, -"startColumn": 46, -"endLine": 231, -"endColumn": 69 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Hosting.Aspnet\DefaultNancyAspNetBootstrapper.cs", @@ -197,19 +158,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'instanceRegistrations' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Hosting.Aspnet\DefaultNancyAspNetBootstrapper.cs", -"region": { -"startLine": 244, -"startColumn": 50, -"endLine": 244, -"endColumn": 71 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Hosting.Aspnet\DefaultNancyAspNetBootstrapper.cs", diff --git a/analyzers/its/expected/Nancy/Nancy.Hosting.Self--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.Hosting.Self--net452-S3900.json index 1132a24af6c..944d9f3533c 100644 --- a/analyzers/its/expected/Nancy/Nancy.Hosting.Self--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Hosting.Self--net452-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'bootstrapper' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'bootstrapper' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Hosting.Self\NancyHost.cs", "region": { diff --git a/analyzers/its/expected/Nancy/Nancy.Hosting.Self--netstandard2.0-S3900.json b/analyzers/its/expected/Nancy/Nancy.Hosting.Self--netstandard2.0-S3900.json index 1132a24af6c..944d9f3533c 100644 --- a/analyzers/its/expected/Nancy/Nancy.Hosting.Self--netstandard2.0-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Hosting.Self--netstandard2.0-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'bootstrapper' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'bootstrapper' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Hosting.Self\NancyHost.cs", "region": { diff --git a/analyzers/its/expected/Nancy/Nancy.Testing--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.Testing--net452-S3900.json index 0f2b66a86d5..400616a718d 100644 --- a/analyzers/its/expected/Nancy/Nancy.Testing--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Testing--net452-S3900.json @@ -15,19 +15,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'query' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\AssertExtensions.cs", -"region": { -"startLine": 83, -"startColumn": 34, -"endLine": 83, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'node' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\AssertExtensions.cs", @@ -67,32 +54,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'query' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\AssertExtensions.cs", -"region": { -"startLine": 152, -"startColumn": 34, -"endLine": 152, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'query' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\AssertExtensions.cs", -"region": { -"startLine": 167, -"startColumn": 34, -"endLine": 167, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'actual' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\Asserts.cs", @@ -106,7 +67,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'bootstrapper' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'bootstrapper' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\Browser.cs", "region": { @@ -149,6 +110,19 @@ "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", "region": { +"startLine": 67, +"startColumn": 13, +"endLine": 67, +"endColumn": 27 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'browserContext' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", +"region": { "startLine": 80, "startColumn": 55, "endLine": 80, @@ -162,23 +136,23 @@ "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", "region": { -"startLine": 104, +"startLine": 89, "startColumn": 13, -"endLine": 104, +"endLine": 89, "endColumn": 27 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'cookies' before using it.", +"message": "Refactor this method to add validation of parameter 'browserContext' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", "region": { -"startLine": 119, -"startColumn": 36, -"endLine": 119, -"endColumn": 43 +"startLine": 104, +"startColumn": 13, +"endLine": 104, +"endColumn": 27 } } }, @@ -210,7 +184,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'configuration' before using it.", +"message": "Refactor this method to add validation of parameter 'browserContext' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", +"region": { +"startLine": 198, +"startColumn": 13, +"endLine": 198, +"endColumn": 27 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'configuration' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserContextMultipartFormData.cs", "region": { @@ -223,7 +210,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'response' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseBodyWrapper.cs", "region": { @@ -279,6 +266,45 @@ "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, @@ -353,19 +379,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'moduleRegistrationTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 540, -"startColumn": 52, -"endLine": 540, -"endColumn": 75 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", @@ -392,19 +405,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'defaultConfigurationProviders' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 737, -"startColumn": 62, -"endLine": 737, -"endColumn": 91 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'instance' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", @@ -418,84 +418,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'dependencies' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 809, -"startColumn": 44, -"endLine": 809, -"endColumn": 56 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'dependencies' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 826, -"startColumn": 44, -"endLine": 826, -"endColumn": 56 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'dependencies' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 842, -"startColumn": 44, -"endLine": 842, -"endColumn": 56 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'routeMetadataProviders' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 1428, -"startColumn": 55, -"endLine": 1428, -"endColumn": 77 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'applicationStartupTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 1977, -"startColumn": 38, -"endLine": 1977, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'requestStartupTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 2006, -"startColumn": 38, -"endLine": 2006, -"endColumn": 57 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'moduleType' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", @@ -522,7 +444,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'closure' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'closure' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\ConfigurableNancyModule.cs", "region": { @@ -535,7 +457,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'closure' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'closure' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\StaticConfigurationContext.cs", "region": { 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 0f2b66a86d5..400616a718d 100644 --- a/analyzers/its/expected/Nancy/Nancy.Testing--netstandard2.0-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Testing--netstandard2.0-S3900.json @@ -15,19 +15,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'query' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\AssertExtensions.cs", -"region": { -"startLine": 83, -"startColumn": 34, -"endLine": 83, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'node' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\AssertExtensions.cs", @@ -67,32 +54,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'query' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\AssertExtensions.cs", -"region": { -"startLine": 152, -"startColumn": 34, -"endLine": 152, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'query' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\AssertExtensions.cs", -"region": { -"startLine": 167, -"startColumn": 34, -"endLine": 167, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'actual' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\Asserts.cs", @@ -106,7 +67,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'bootstrapper' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'bootstrapper' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\Browser.cs", "region": { @@ -149,6 +110,19 @@ "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", "region": { +"startLine": 67, +"startColumn": 13, +"endLine": 67, +"endColumn": 27 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'browserContext' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", +"region": { "startLine": 80, "startColumn": 55, "endLine": 80, @@ -162,23 +136,23 @@ "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", "region": { -"startLine": 104, +"startLine": 89, "startColumn": 13, -"endLine": 104, +"endLine": 89, "endColumn": 27 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'cookies' before using it.", +"message": "Refactor this method to add validation of parameter 'browserContext' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", "region": { -"startLine": 119, -"startColumn": 36, -"endLine": 119, -"endColumn": 43 +"startLine": 104, +"startColumn": 13, +"endLine": 104, +"endColumn": 27 } } }, @@ -210,7 +184,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'configuration' before using it.", +"message": "Refactor this method to add validation of parameter 'browserContext' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy.Testing\BrowserContextExtensions.cs", +"region": { +"startLine": 198, +"startColumn": 13, +"endLine": 198, +"endColumn": 27 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'configuration' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserContextMultipartFormData.cs", "region": { @@ -223,7 +210,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'response' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'response' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\BrowserResponseBodyWrapper.cs", "region": { @@ -279,6 +266,45 @@ "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, @@ -353,19 +379,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'moduleRegistrationTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 540, -"startColumn": 52, -"endLine": 540, -"endColumn": 75 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'container' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", @@ -392,19 +405,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'defaultConfigurationProviders' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 737, -"startColumn": 62, -"endLine": 737, -"endColumn": 91 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'instance' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", @@ -418,84 +418,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'dependencies' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 809, -"startColumn": 44, -"endLine": 809, -"endColumn": 56 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'dependencies' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 826, -"startColumn": 44, -"endLine": 826, -"endColumn": 56 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'dependencies' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 842, -"startColumn": 44, -"endLine": 842, -"endColumn": 56 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'routeMetadataProviders' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 1428, -"startColumn": 55, -"endLine": 1428, -"endColumn": 77 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'applicationStartupTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 1977, -"startColumn": 38, -"endLine": 1977, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'requestStartupTypes' before using it.", -"location": { -"uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", -"region": { -"startLine": 2006, -"startColumn": 38, -"endLine": 2006, -"endColumn": 57 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'moduleType' before using it.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\ConfigurableBootstrapper.cs", @@ -522,7 +444,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'closure' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'closure' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\ConfigurableNancyModule.cs", "region": { @@ -535,7 +457,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'closure' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'closure' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Testing\StaticConfigurationContext.cs", "region": { diff --git a/analyzers/its/expected/Nancy/Nancy.Validation.DataAnnotations--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.Validation.DataAnnotations--net452-S3900.json index 4022fa4bb63..b161e757e4c 100644 --- a/analyzers/its/expected/Nancy/Nancy.Validation.DataAnnotations--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.Validation.DataAnnotations--net452-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'factory' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'factory' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.Validation.DataAnnotations\DataAnnotationsValidator.cs", "region": { @@ -19,19 +19,6 @@ "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, @@ -54,19 +41,6 @@ }, { "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", @@ -80,19 +54,6 @@ }, { "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", @@ -106,19 +67,6 @@ }, { "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", @@ -132,19 +80,6 @@ }, { "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", 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 90f6239c4ff..1130ea89979 100644 --- a/analyzers/its/expected/Nancy/Nancy.ViewEngines.DotLiquid--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.ViewEngines.DotLiquid--net452-S3900.json @@ -2,6 +2,45 @@ "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/Nancy/Nancy.ViewEngines.Markdown--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.ViewEngines.Markdown--net452-S3900.json index 6d50a524740..9dc1cfdc922 100644 --- a/analyzers/its/expected/Nancy/Nancy.ViewEngines.Markdown--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.ViewEngines.Markdown--net452-S3900.json @@ -38,6 +38,19 @@ "endColumn": 31 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'templateContent' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy.ViewEngines.Markdown\MarkdownViewengineRender.cs", +"region": { +"startLine": 32, +"startColumn": 20, +"endLine": 32, +"endColumn": 35 +} +} } ] } diff --git a/analyzers/its/expected/Nancy/Nancy.ViewEngines.Markdown--netstandard2.0-S3900.json b/analyzers/its/expected/Nancy/Nancy.ViewEngines.Markdown--netstandard2.0-S3900.json index 6d50a524740..9dc1cfdc922 100644 --- a/analyzers/its/expected/Nancy/Nancy.ViewEngines.Markdown--netstandard2.0-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.ViewEngines.Markdown--netstandard2.0-S3900.json @@ -38,6 +38,19 @@ "endColumn": 31 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'templateContent' before using it.", +"location": { +"uri": "sources\Nancy\src\Nancy.ViewEngines.Markdown\MarkdownViewengineRender.cs", +"region": { +"startLine": 32, +"startColumn": 20, +"endLine": 32, +"endColumn": 35 +} +} } ] } diff --git a/analyzers/its/expected/Nancy/Nancy.ViewEngines.Spark--net452-S3900.json b/analyzers/its/expected/Nancy/Nancy.ViewEngines.Spark--net452-S3900.json index 1322cd85b74..d18177566fb 100644 --- a/analyzers/its/expected/Nancy/Nancy.ViewEngines.Spark--net452-S3900.json +++ b/analyzers/its/expected/Nancy/Nancy.ViewEngines.Spark--net452-S3900.json @@ -41,7 +41,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'viewEngineStartupContext' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'viewEngineStartupContext' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.ViewEngines.Spark\NancyViewFolder.cs", "region": { @@ -54,7 +54,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'searchedLocations' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'searchedLocations' because it could be null.", "location": { "uri": "sources\Nancy\src\Nancy.ViewEngines.Spark\SparkViewEngineResult.cs", "region": { diff --git a/analyzers/its/expected/Net5/Net5--net5.0-S3900.json b/analyzers/its/expected/Net5/Net5--net5.0-S3900.json index 7a4c6f94eda..bb3d3b851cf 100644 --- a/analyzers/its/expected/Net5/Net5--net5.0-S3900.json +++ b/analyzers/its/expected/Net5/Net5--net5.0-S3900.json @@ -2,27 +2,14 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'collection' before using it.", +"message": "Refactor this method to add validation of parameter 'condition' before using it.", "location": { "uri": "sources\Net5\Net5\S3267.cs", "region": { -"startLine": 12, -"startColumn": 37, -"endLine": 12, -"endColumn": 47 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'collection' before using it.", -"location": { -"uri": "sources\Net5\Net5\S3267.cs", -"region": { -"startLine": 27, -"startColumn": 37, -"endLine": 27, -"endColumn": 47 +"startLine": 14, +"startColumn": 21, +"endLine": 14, +"endColumn": 30 } } } 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 f248b98e414..df9f0b8c77c 100644 --- a/analyzers/its/expected/akka.net/Akka--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka--netstandard2.0-S3900.json @@ -93,66 +93,66 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'watchee' before using it.", +"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": 258, +"startLine": 230, "startColumn": 31, -"endLine": 258, +"endLine": 230, "endColumn": 38 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 's' before using it.", +"message": "Refactor this method to add validation of parameter 'watchee' before using it.", "location": { -"uri": "sources\akka.net\src\core\Akka\Actor\ActorPath.cs", +"uri": "sources\akka.net\src\core\Akka\Actor\ActorCell.DeathWatch.cs", "region": { -"startLine": 124, -"startColumn": 21, -"endLine": 124, -"endColumn": 22 +"startLine": 258, +"startColumn": 31, +"endLine": 258, +"endColumn": 38 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'parentPath' before using it.", +"message": "Refactor this method to add validation of parameter 'watcher' before using it.", "location": { -"uri": "sources\akka.net\src\core\Akka\Actor\ActorPath.cs", +"uri": "sources\akka.net\src\core\Akka\Actor\ActorCell.DeathWatch.cs", "region": { -"startLine": 174, -"startColumn": 23, -"endLine": 174, -"endColumn": 33 +"startLine": 259, +"startColumn": 31, +"endLine": 259, +"endColumn": 38 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'name' before using it.", +"message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorPath.cs", "region": { -"startLine": 293, -"startColumn": 40, -"endLine": 293, -"endColumn": 44 +"startLine": 77, +"startColumn": 44, +"endLine": 77, +"endColumn": 49 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'actorPath' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'parentPath' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorPath.cs", "region": { -"startLine": 339, -"startColumn": 29, -"endLine": 339, -"endColumn": 38 +"startLine": 174, +"startColumn": 23, +"endLine": 174, +"endColumn": 33 } } }, @@ -197,6 +197,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'elseValue' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\ActorRef.Extensions.cs", +"region": { +"startLine": 37, +"startColumn": 42, +"endLine": 37, +"endColumn": 51 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'factory' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorRefFactoryExtensions.cs", @@ -223,19 +236,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Actor\ActorRefFactoryShared.cs", -"region": { -"startLine": 55, -"startColumn": 43, -"endLine": 55, -"endColumn": 49 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'path' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorRefProvider.cs", @@ -340,14 +340,14 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'elements' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorSelection.cs", "region": { -"startLine": 82, -"startColumn": 31, -"endLine": 82, -"endColumn": 39 +"startLine": 300, +"startColumn": 17, +"endLine": 300, +"endColumn": 20 } } }, @@ -379,6 +379,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\ActorSelection.cs", +"region": { +"startLine": 422, +"startColumn": 17, +"endLine": 422, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorSelection.cs", @@ -392,6 +405,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\ActorSelection.cs", +"region": { +"startLine": 460, +"startColumn": 17, +"endLine": 460, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'setup' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\ActorSystem.cs", @@ -405,6 +431,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\Address.cs", +"region": { +"startLine": 150, +"startColumn": 28, +"endLine": 150, +"endColumn": 33 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'addr' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Address.cs", @@ -639,7 +678,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'info' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'info' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Exceptions.cs", "region": { @@ -652,7 +691,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'info' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'info' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Exceptions.cs", "region": { @@ -665,7 +704,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'info' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'info' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Exceptions.cs", "region": { @@ -678,7 +717,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'info' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'info' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Exceptions.cs", "region": { @@ -756,6 +795,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\FSM.cs", +"region": { +"startLine": 556, +"startColumn": 71, +"endLine": 556, +"endColumn": 76 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\FSM.cs", +"region": { +"startLine": 564, +"startColumn": 21, +"endLine": 564, +"endColumn": 24 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'stopMessage' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\GracefulStopSupport.cs", @@ -769,6 +834,32 @@ }, { "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 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\IAutoReceivedMessage.cs", +"region": { +"startLine": 70, +"startColumn": 37, +"endLine": 70, +"endColumn": 42 +} +} +}, +{ +"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", @@ -795,6 +886,19 @@ }, { "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", @@ -821,20 +925,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'name' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Actor\LocalActorRef.cs", -"region": { -"startLine": 218, -"startColumn": 40, -"endLine": 218, -"endColumn": 44 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Message.cs", "region": { @@ -886,6 +977,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\Props.cs", +"region": { +"startLine": 327, +"startColumn": 17, +"endLine": 327, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'factory' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\Props.cs", @@ -912,6 +1016,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\RemoteScope.cs", +"region": { +"startLine": 44, +"startColumn": 36, +"endLine": 44, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\RemoteScope.cs", +"region": { +"startLine": 52, +"startColumn": 17, +"endLine": 52, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'cell' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\RepointableActorRef.cs", @@ -1120,6 +1250,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\SupervisorStrategy.cs", +"region": { +"startLine": 458, +"startColumn": 46, +"endLine": 458, +"endColumn": 51 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'children' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\SupervisorStrategy.cs", @@ -1159,6 +1302,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\SupervisorStrategy.cs", +"region": { +"startLine": 724, +"startColumn": 46, +"endLine": 724, +"endColumn": 51 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\SupervisorStrategy.cs", +"region": { +"startLine": 984, +"startColumn": 44, +"endLine": 984, +"endColumn": 49 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'message' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Actor\TypedActor.cs", @@ -1172,7 +1341,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'root' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'root' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Configuration\Config.cs", "region": { @@ -1328,19 +1497,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'patterns' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Configuration\Hocon\HoconTokenizer.cs", -"region": { -"startLine": 121, -"startColumn": 40, -"endLine": 121, -"endColumn": 48 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'ex' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Dispatch\AbstractDispatcher.cs", @@ -1406,7 +1562,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'prerequisites' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'prerequisites' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Dispatch\Dispatchers.cs", "region": { @@ -1432,7 +1588,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Dispatch\Mailbox.cs", "region": { @@ -1445,7 +1601,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Dispatch\Mailbox.cs", "region": { @@ -1458,7 +1614,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Dispatch\Mailboxes.cs", "region": { @@ -1575,7 +1731,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'bus' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Dispatch\SysMsg\ISystemMessage.cs", +"region": { +"startLine": 488, +"startColumn": 17, +"endLine": 488, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'bus' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Event\BusLogging.cs", "region": { @@ -1783,7 +1952,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'event' before using it.", +"message": "Refactor this method to add validation of parameter '@event' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Event\LoggingBus.cs", "region": { @@ -1822,9 +1991,22 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this method to add validation of parameter 'logEvent' before using it.", "location": { -"uri": "sources\akka.net\src\core\Akka\IO\Dns.cs", +"uri": "sources\akka.net\src\core\Akka\Event\StandardOutLogger.cs", +"region": { +"startLine": 146, +"startColumn": 49, +"endLine": 146, +"endColumn": 57 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", +"location": { +"uri": "sources\akka.net\src\core\Akka\IO\Dns.cs", "region": { "startLine": 212, "startColumn": 30, @@ -1835,7 +2017,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\IO\Dns.cs", "region": { @@ -1939,7 +2121,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\IO\InetAddressDnsResolver.cs", "region": { @@ -1952,7 +2134,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'ext' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'ext' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\IO\SimpleDnsManager.cs", "region": { @@ -2043,7 +2225,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\IO\Udp.cs", "region": { @@ -2056,7 +2238,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\IO\Udp.cs", "region": { @@ -2082,7 +2264,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\IO\UdpConnected.cs", "region": { @@ -2095,7 +2277,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\IO\UdpConnected.cs", "region": { @@ -2147,6 +2329,19 @@ }, { "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", @@ -2160,7 +2355,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'info' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'info' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Pattern\OpenCircuitException.cs", "region": { @@ -2199,6 +2394,19 @@ }, { "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", @@ -2212,33 +2420,33 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'hash' before using it.", +"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": 193, -"startColumn": 42, -"endLine": 193, -"endColumn": 46 +"startLine": 192, +"startColumn": 51, +"endLine": 192, +"endColumn": 55 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nodes' before using it.", +"message": "Refactor this method to add validation of parameter 'hash' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Routing\ConsistentHash.cs", "region": { -"startLine": 215, -"startColumn": 34, -"endLine": 215, -"endColumn": 39 +"startLine": 193, +"startColumn": 42, +"endLine": 193, +"endColumn": 46 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Routing\ConsistentHashRouter.cs", "region": { @@ -2329,14 +2537,27 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'routees' before using it.", +"message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { -"uri": "sources\akka.net\src\core\Akka\Routing\RoundRobin.cs", +"uri": "sources\akka.net\src\core\Akka\Routing\Resizer.cs", "region": { -"startLine": 53, +"startLine": 352, +"startColumn": 41, +"endLine": 352, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Routing\Resizer.cs", +"region": { +"startLine": 360, "startColumn": 17, -"endLine": 53, -"endColumn": 24 +"endLine": 360, +"endColumn": 20 } } }, @@ -2346,10 +2567,10 @@ "location": { "uri": "sources\akka.net\src\core\Akka\Routing\RoundRobin.cs", "region": { -"startLine": 57, -"startColumn": 24, -"endLine": 57, -"endColumn": 31 +"startLine": 53, +"startColumn": 17, +"endLine": 53, +"endColumn": 24 } } }, @@ -2381,6 +2602,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Routing\Router.cs", +"region": { +"startLine": 125, +"startColumn": 17, +"endLine": 125, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Routing\Router.cs", @@ -2394,6 +2628,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Routing\Router.cs", +"region": { +"startLine": 183, +"startColumn": 17, +"endLine": 183, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Routing\Router.cs", @@ -2420,6 +2667,45 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Routing\RouterConfig.cs", +"region": { +"startLine": 126, +"startColumn": 33, +"endLine": 126, +"endColumn": 38 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Routing\RouterConfig.cs", +"region": { +"startLine": 204, +"startColumn": 48, +"endLine": 204, +"endColumn": 53 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Routing\RouterConfig.cs", +"region": { +"startLine": 212, +"startColumn": 17, +"endLine": 212, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'routeeProps' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Routing\RouterConfig.cs", @@ -2433,6 +2719,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Routing\RouterConfig.cs", +"region": { +"startLine": 363, +"startColumn": 36, +"endLine": 363, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Routing\RouterConfig.cs", +"region": { +"startLine": 372, +"startColumn": 17, +"endLine": 372, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'routeeProps' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Routing\RouterConfig.cs", @@ -2550,7 +2862,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka\Serialization\NewtonSoftJsonSerializer.cs", "region": { @@ -2563,6 +2875,45 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", +"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 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", +"region": { +"startLine": 47, +"startColumn": 35, +"endLine": 47, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", +"region": { +"startLine": 54, +"startColumn": 17, +"endLine": 54, +"endColumn": 20 +} +} +}, +{ +"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", @@ -2576,6 +2927,58 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", +"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 constructor to avoid using members of parameter 'system' because it could be null.", +"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 constructor to avoid using members of parameter 'system' because it could be null.", +"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 constructor to avoid using members of parameter 'system' because it could be null.", +"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", @@ -2589,6 +2992,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'action' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", +"region": { +"startLine": 245, +"startColumn": 24, +"endLine": 245, +"endColumn": 30 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'action' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", +"region": { +"startLine": 252, +"startColumn": 24, +"endLine": 252, +"endColumn": 30 +} +} +}, +{ +"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", @@ -2602,6 +3031,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'action' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", +"region": { +"startLine": 277, +"startColumn": 24, +"endLine": 277, +"endColumn": 30 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'action' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", +"region": { +"startLine": 284, +"startColumn": 24, +"endLine": 284, +"endColumn": 30 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'serializer' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Serialization\Serialization.cs", @@ -2693,6 +3148,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'first' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Util\AppVersion.cs", +"region": { +"startLine": 258, +"startColumn": 20, +"endLine": 258, +"endColumn": 25 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'atomicBoolean' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Util\AtomicBoolean.cs", @@ -2810,6 +3278,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka\Util\ByteString.cs", +"region": { +"startLine": 551, +"startColumn": 27, +"endLine": 551, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'encoding' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Util\ByteString.cs", @@ -2927,14 +3408,14 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'source' before using it.", +"message": "Refactor this method to add validation of parameter 'action' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Util\Internal\Extensions.cs", "region": { -"startLine": 198, -"startColumn": 34, -"endLine": 198, -"endColumn": 40 +"startLine": 199, +"startColumn": 17, +"endLine": 199, +"endColumn": 23 } } }, @@ -2966,19 +3447,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'xs' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka\Util\MurmurHash.cs", -"region": { -"startLine": 237, -"startColumn": 35, -"endLine": 237, -"endColumn": 37 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'arr' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka\Util\MurmurHash.cs", 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 cdb5cdac8d1..685ace5e4ac 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,6 +2,45 @@ "issues": [ { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", +"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 constructor to avoid using members of parameter 'system' because it could be null.", +"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 constructor to avoid using members of parameter 'system' because it could be null.", +"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", @@ -28,7 +67,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\ClusterActorRefProvider.cs", "region": { @@ -54,7 +93,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'member' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'member' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\ClusterEvent.cs", "region": { @@ -67,7 +106,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'member' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'member' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\ClusterEvent.cs", "region": { @@ -80,7 +119,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\ClusterSettings.cs", "region": { @@ -132,6 +171,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\Member.cs", +"region": { +"startLine": 501, +"startColumn": 27, +"endLine": 501, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'config' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\Routing\ClusterRoutingConfig.cs", @@ -158,6 +210,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\Routing\ClusterRoutingConfig.cs", +"region": { +"startLine": 189, +"startColumn": 17, +"endLine": 189, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\Routing\ClusterRoutingConfig.cs", @@ -210,7 +275,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolverProvider.cs", "region": { @@ -223,7 +288,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolverSettings.cs", "region": { @@ -262,7 +327,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\SplitBrainResolver.cs", "region": { @@ -275,19 +340,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'value' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Cluster\VectorClock.cs", -"region": { -"startLine": 90, -"startColumn": 39, -"endLine": 90, -"endColumn": 44 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\VectorClock.cs", @@ -327,6 +379,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'left' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\VectorClock.cs", +"region": { +"startLine": 328, +"startColumn": 20, +"endLine": 328, +"endColumn": 24 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'left' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\VectorClock.cs", +"region": { +"startLine": 342, +"startColumn": 20, +"endLine": 342, +"endColumn": 24 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'that' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Cluster\VectorClock.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Cluster.Metrics--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Cluster.Metrics--netstandard2.0-S3900.json index 1963c766a26..894a55de38f 100644 --- a/analyzers/its/expected/akka.net/Akka.Cluster.Metrics--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Cluster.Metrics--netstandard2.0-S3900.json @@ -15,7 +15,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Metrics\Configuration\ClusterMetricsSettings.cs", "region": { @@ -41,7 +41,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'event' before using it.", +"message": "Refactor this method to add validation of parameter '@event' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Metrics\Routing\ClusterMetricsRouting.cs", "region": { @@ -223,6 +223,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Metrics\Serialization\Metric.cs", +"region": { +"startLine": 178, +"startColumn": 36, +"endLine": 178, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'otherGossip' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Metrics\Serialization\MetricsGossip.cs", @@ -301,6 +314,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Metrics\Serialization\NodeMetrics.cs", +"region": { +"startLine": 102, +"startColumn": 36, +"endLine": 102, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'nodeMetrics' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Metrics\StandardMetrics.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 e5e6b92f5d8..441a9e26d2f 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 @@ -28,32 +28,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'messageExtractor' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ClusterSharding.cs", -"region": { -"startLine": 514, -"startColumn": 45, -"endLine": 514, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'messageExtractor' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ClusterSharding.cs", -"region": { -"startLine": 546, -"startColumn": 45, -"endLine": 546, -"endColumn": 61 -} -} -}, -{ -"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\ClusterSharding.cs", @@ -80,58 +54,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'messageExtractor' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ClusterSharding.cs", -"region": { -"startLine": 841, -"startColumn": 45, -"endLine": 841, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'messageExtractor' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ClusterSharding.cs", -"region": { -"startLine": 873, -"startColumn": 45, -"endLine": 873, -"endColumn": 61 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'messageExtractor' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ClusterSharding.cs", -"region": { -"startLine": 1042, -"startColumn": 64, -"endLine": 1042, -"endColumn": 80 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'messageExtractor' before using it.", -"location": { -"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ClusterSharding.cs", -"region": { -"startLine": 1069, -"startColumn": 69, -"endLine": 1069, -"endColumn": 85 -} -} -}, -{ -"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\ClusterSharding.cs", @@ -197,6 +119,32 @@ }, { "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", @@ -236,6 +184,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ShardingMessages.cs", +"region": { +"startLine": 128, +"startColumn": 36, +"endLine": 128, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'member' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\ShardRegion.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Cluster.Tools--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Cluster.Tools--netstandard2.0-S3900.json index 8943750e81a..d0bceef1631 100644 --- a/analyzers/its/expected/akka.net/Akka.Cluster.Tools--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Cluster.Tools--netstandard2.0-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\Client\ClusterClient.cs", "region": { @@ -15,6 +15,19 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\Client\ClusterClientReceptionist.cs", +"region": { +"startLine": 54, +"startColumn": 23, +"endLine": 54, +"endColumn": 29 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'actorRef' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\Client\ClusterClientReceptionist.cs", @@ -119,7 +132,137 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 41, +"startColumn": 32, +"endLine": 41, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 88, +"startColumn": 33, +"endLine": 88, +"endColumn": 38 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 154, +"startColumn": 34, +"endLine": 154, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 228, +"startColumn": 34, +"endLine": 228, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 284, +"startColumn": 38, +"endLine": 284, +"endColumn": 43 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 330, +"startColumn": 40, +"endLine": 330, +"endColumn": 45 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 389, +"startColumn": 34, +"endLine": 389, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 456, +"startColumn": 33, +"endLine": 456, +"endColumn": 38 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 525, +"startColumn": 40, +"endLine": 525, +"endColumn": 45 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedMessages.cs", +"region": { +"startLine": 594, +"startColumn": 41, +"endLine": 594, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedPubSubMediator.cs", "region": { @@ -184,7 +327,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\Singleton\ClusterSingletonManager.cs", "region": { @@ -223,7 +366,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\Singleton\ClusterSingletonProxy.cs", "region": { 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 e9b723caa05..60c24e67efc 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 @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Discovery\Aggregate\AggregateServiceDiscovery.cs", "region": { @@ -15,7 +15,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Discovery\Aggregate\AggregateServiceDiscovery.cs", "region": { @@ -28,7 +28,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"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 constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Discovery\Config\ConfigServiceDiscovery.cs", "region": { diff --git a/analyzers/its/expected/akka.net/Akka.DistributedData--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.DistributedData--netstandard2.0-S3900.json index dbea244a38b..fbb94430615 100644 --- a/analyzers/its/expected/akka.net/Akka.DistributedData--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.DistributedData--netstandard2.0-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\DistributedData.cs", "region": { @@ -15,6 +15,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Durable\Messages.cs", +"region": { +"startLine": 121, +"startColumn": 32, +"endLine": 121, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'newData' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\FastMerge.cs", @@ -45,6 +58,19 @@ "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Flag.cs", "region": { +"startLine": 64, +"startColumn": 31, +"endLine": 64, +"endColumn": 36 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Flag.cs", +"region": { "startLine": 90, "startColumn": 42, "endLine": 90, @@ -93,6 +119,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\GCounter.cs", +"region": { +"startLine": 195, +"startColumn": 40, +"endLine": 195, +"endColumn": 45 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'counter' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\GCounter.cs", @@ -119,6 +158,71 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\GSet.cs", +"region": { +"startLine": 158, +"startColumn": 39, +"endLine": 158, +"endColumn": 44 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Internal\Internal.cs", +"region": { +"startLine": 565, +"startColumn": 30, +"endLine": 565, +"endColumn": 35 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Internal\Internal.cs", +"region": { +"startLine": 841, +"startColumn": 41, +"endLine": 841, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Internal\Internal.cs", +"region": { +"startLine": 906, +"startColumn": 35, +"endLine": 906, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'key' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Key.cs", +"region": { +"startLine": 60, +"startColumn": 26, +"endLine": 60, +"endColumn": 29 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'key' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Key.cs", @@ -173,6 +277,19 @@ "id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\LWWDictionary.cs", +"region": { +"startLine": 315, +"startColumn": 38, +"endLine": 315, +"endColumn": 43 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\LWWRegister.cs", "region": { "startLine": 178, @@ -184,6 +301,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\LWWRegister.cs", +"region": { +"startLine": 197, +"startColumn": 33, +"endLine": 197, +"endColumn": 38 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'node' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ORDictionary.cs", @@ -236,6 +366,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ORDictionary.cs", +"region": { +"startLine": 410, +"startColumn": 35, +"endLine": 410, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'node' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ORMultiValueDictionary.cs", @@ -314,6 +457,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ORMultiValueDictionary.cs", +"region": { +"startLine": 278, +"startColumn": 39, +"endLine": 278, +"endColumn": 44 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'cluster' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ORSet.cs", @@ -366,6 +522,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ORSet.cs", +"region": { +"startLine": 441, +"startColumn": 37, +"endLine": 441, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'node' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\PNCounter.cs", @@ -405,6 +574,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\PNCounter.cs", +"region": { +"startLine": 109, +"startColumn": 20, +"endLine": 109, +"endColumn": 25 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'node' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\PNCounterDictionary.cs", @@ -457,6 +639,253 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\PNCounterDictionary.cs", +"region": { +"startLine": 188, +"startColumn": 39, +"endLine": 188, +"endColumn": 44 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ReadAggregator.cs", +"region": { +"startLine": 168, +"startColumn": 25, +"endLine": 168, +"endColumn": 30 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ReadAggregator.cs", +"region": { +"startLine": 209, +"startColumn": 35, +"endLine": 209, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ReadAggregator.cs", +"region": { +"startLine": 245, +"startColumn": 35, +"endLine": 245, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 51, +"startColumn": 35, +"endLine": 51, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 94, +"startColumn": 32, +"endLine": 94, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 190, +"startColumn": 32, +"endLine": 190, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 241, +"startColumn": 32, +"endLine": 241, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 291, +"startColumn": 32, +"endLine": 291, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 351, +"startColumn": 32, +"endLine": 351, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 392, +"startColumn": 32, +"endLine": 392, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 441, +"startColumn": 32, +"endLine": 441, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 571, +"startColumn": 32, +"endLine": 571, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 630, +"startColumn": 32, +"endLine": 630, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 733, +"startColumn": 33, +"endLine": 733, +"endColumn": 38 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 778, +"startColumn": 32, +"endLine": 778, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 852, +"startColumn": 32, +"endLine": 852, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 883, +"startColumn": 32, +"endLine": 883, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.Messages.cs", +"region": { +"startLine": 919, +"startColumn": 32, +"endLine": 919, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'system' before using it.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\ReplicatorSettings.cs", @@ -509,7 +938,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Serialization\ReplicatorMessageSerializer.cs", "region": { @@ -584,6 +1013,45 @@ "endColumn": 17 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\WriteAggregator.cs", +"region": { +"startLine": 211, +"startColumn": 29, +"endLine": 211, +"endColumn": 34 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\WriteAggregator.cs", +"region": { +"startLine": 243, +"startColumn": 35, +"endLine": 243, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\WriteAggregator.cs", +"region": { +"startLine": 273, +"startColumn": 35, +"endLine": 273, +"endColumn": 40 +} +} } ] } diff --git a/analyzers/its/expected/akka.net/Akka.DistributedData.LightningDB--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.DistributedData.LightningDB--netstandard2.0-S3900.json index 23a3db448e0..09a72c2a870 100644 --- a/analyzers/its/expected/akka.net/Akka.DistributedData.LightningDB--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.DistributedData.LightningDB--netstandard2.0-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData.LightningDB\LmdbDurableStore.cs", "region": { diff --git a/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner.Shared--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner.Shared--netstandard2.0-S3900.json index 5abaead9e02..0d878637d44 100644 --- a/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner.Shared--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner.Shared--netstandard2.0-S3900.json @@ -2,19 +2,6 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'source' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Persistence\EnumerableExtensions.cs", -"region": { -"startLine": 16, -"startColumn": 33, -"endLine": 16, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'assemblyName' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Persistence\FileNameGenerator.cs", @@ -132,14 +119,40 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nodeDatum' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\MultiNodeMessage.cs", +"region": { +"startLine": 93, +"startColumn": 17, +"endLine": 93, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", "region": { -"startLine": 212, -"startColumn": 33, -"endLine": 212, -"endColumn": 42 +"startLine": 99, +"startColumn": 38, +"endLine": 99, +"endColumn": 43 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 110, +"startColumn": 17, +"endLine": 110, +"endColumn": 20 } } }, @@ -158,6 +171,58 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 251, +"startColumn": 41, +"endLine": 251, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 264, +"startColumn": 17, +"endLine": 264, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 396, +"startColumn": 45, +"endLine": 396, +"endColumn": 50 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 409, +"startColumn": 17, +"endLine": 409, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'nodeFail' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\ConsoleMessageSinkActor.cs", @@ -366,7 +431,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'msg' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'msg' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\TimelineLogCollectorActor.cs", "region": { @@ -379,6 +444,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\TimelineLogCollectorActor.cs", +"region": { +"startLine": 159, +"startColumn": 33, +"endLine": 159, +"endColumn": 38 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\TimelineLogCollectorActor.cs", +"region": { +"startLine": 167, +"startColumn": 21, +"endLine": 167, +"endColumn": 24 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'endSpec' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\TrxSinkActor.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 429651c3b0d..65c59fc0535 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 @@ -28,7 +28,59 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", +"region": { +"startLine": 64, +"startColumn": 46, +"endLine": 64, +"endColumn": 51 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", +"region": { +"startLine": 120, +"startColumn": 50, +"endLine": 120, +"endColumn": 55 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", +"region": { +"startLine": 175, +"startColumn": 39, +"endLine": 175, +"endColumn": 44 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", +"region": { +"startLine": 269, +"startColumn": 40, +"endLine": 269, +"endColumn": 45 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", "region": { @@ -54,7 +106,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'event' before using it.", +"message": "Refactor this method to add validation of parameter '@event' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Eventsourced.cs", "region": { @@ -67,7 +119,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'event' before using it.", +"message": "Refactor this method to add validation of parameter '@event' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Eventsourced.cs", "region": { @@ -106,6 +158,58 @@ }, { "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", @@ -119,6 +223,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Fsm\PersistentFSM.cs", +"region": { +"startLine": 244, +"startColumn": 21, +"endLine": 244, +"endColumn": 24 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'events' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Fsm\PersistentFSM.cs", @@ -145,27 +262,53 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'context' before using it.", +"message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Journal\AsyncWriteProxy.cs", "region": { -"startLine": 375, -"startColumn": 28, -"endLine": 375, -"endColumn": 35 +"startLine": 138, +"startColumn": 45, +"endLine": 138, +"endColumn": 50 } } }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'messages' before using it.", +"message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { -"uri": "sources\akka.net\src\core\Akka.Persistence\Journal\MemoryJournal.cs", +"uri": "sources\akka.net\src\core\Akka.Persistence\Journal\AsyncWriteProxy.cs", "region": { -"startLine": 84, -"startColumn": 31, -"endLine": 84, -"endColumn": 39 +"startLine": 210, +"startColumn": 41, +"endLine": 210, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Journal\AsyncWriteProxy.cs", +"region": { +"startLine": 250, +"startColumn": 41, +"endLine": 250, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'context' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Journal\AsyncWriteProxy.cs", +"region": { +"startLine": 375, +"startColumn": 28, +"endLine": 375, +"endColumn": 35 } } }, @@ -210,7 +353,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Journal\PersistencePluginProxy.cs", "region": { @@ -249,6 +392,188 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 56, +"startColumn": 36, +"endLine": 56, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 108, +"startColumn": 34, +"endLine": 108, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 173, +"startColumn": 49, +"endLine": 173, +"endColumn": 54 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 237, +"startColumn": 44, +"endLine": 237, +"endColumn": 49 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 326, +"startColumn": 34, +"endLine": 326, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 373, +"startColumn": 44, +"endLine": 373, +"endColumn": 49 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 441, +"startColumn": 44, +"endLine": 441, +"endColumn": 49 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 512, +"startColumn": 44, +"endLine": 512, +"endColumn": 49 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 569, +"startColumn": 44, +"endLine": 569, +"endColumn": 49 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 643, +"startColumn": 42, +"endLine": 643, +"endColumn": 47 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 697, +"startColumn": 39, +"endLine": 697, +"endColumn": 44 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 740, +"startColumn": 46, +"endLine": 740, +"endColumn": 51 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\JournalProtocol.cs", +"region": { +"startLine": 786, +"startColumn": 34, +"endLine": 786, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Persistence.cs", +"region": { +"startLine": 73, +"startColumn": 23, +"endLine": 73, +"endColumn": 29 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'actor' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Persistence.cs", @@ -262,7 +587,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Persistence.cs", "region": { @@ -275,7 +600,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Persistence.cs", "region": { @@ -288,7 +613,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence\Persistence.cs", "region": { @@ -376,6 +701,201 @@ "endColumn": 69 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 112, +"startColumn": 49, +"endLine": 112, +"endColumn": 54 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 157, +"startColumn": 37, +"endLine": 157, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 196, +"startColumn": 37, +"endLine": 196, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 235, +"startColumn": 37, +"endLine": 235, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 290, +"startColumn": 34, +"endLine": 290, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 348, +"startColumn": 34, +"endLine": 348, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 400, +"startColumn": 34, +"endLine": 400, +"endColumn": 39 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 453, +"startColumn": 37, +"endLine": 453, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 551, +"startColumn": 37, +"endLine": 551, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 609, +"startColumn": 37, +"endLine": 609, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 668, +"startColumn": 41, +"endLine": 668, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 725, +"startColumn": 41, +"endLine": 725, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 817, +"startColumn": 37, +"endLine": 817, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 868, +"startColumn": 37, +"endLine": 868, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 914, +"startColumn": 42, +"endLine": 914, +"endColumn": 47 +} +} } ] } diff --git a/analyzers/its/expected/akka.net/Akka.Persistence.Query--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Persistence.Query--netstandard2.0-S3900.json index 3e38649b19b..9221ee619eb 100644 --- a/analyzers/its/expected/akka.net/Akka.Persistence.Query--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Persistence.Query--netstandard2.0-S3900.json @@ -4,6 +4,19 @@ "id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { +"uri": "sources\akka.net\src\core\Akka.Persistence.Query\EventEnvelope.cs", +"region": { +"startLine": 59, +"startColumn": 30, +"endLine": 59, +"endColumn": 35 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { "uri": "sources\akka.net\src\core\Akka.Persistence.Query\Offset.cs", "region": { "startLine": 62, diff --git a/analyzers/its/expected/akka.net/Akka.Persistence.Query.Sql--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Persistence.Query.Sql--netstandard2.0-S3900.json index d5f2b205b14..04b5b65de06 100644 --- a/analyzers/its/expected/akka.net/Akka.Persistence.Query.Sql--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Persistence.Query.Sql--netstandard2.0-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Query.Sql\SqlReadJournal.cs", "region": { @@ -12,6 +12,32 @@ "endColumn": 38 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'offset' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Query.Sql\SqlReadJournal.cs", +"region": { +"startLine": 211, +"startColumn": 84, +"endLine": 211, +"endColumn": 90 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'offset' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Query.Sql\SqlReadJournal.cs", +"region": { +"startLine": 232, +"startColumn": 84, +"endLine": 232, +"endColumn": 90 +} +} } ] } 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 5e294a87e79..28db438cf37 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 @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\BatchingSqlJournal.cs", "region": { @@ -15,7 +15,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\BatchingSqlJournal.cs", "region": { @@ -28,7 +28,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\BatchingSqlJournal.cs", "region": { @@ -223,6 +223,19 @@ }, { "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", @@ -340,7 +353,33 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"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 constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Settings.cs", "region": { @@ -353,7 +392,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Settings.cs", "region": { @@ -370,6 +409,19 @@ "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.Persistence.Sqlite--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Persistence.Sqlite--netstandard2.0-S3900.json index cc799f55f6d..343e3f12dde 100644 --- a/analyzers/its/expected/akka.net/Akka.Persistence.Sqlite--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Persistence.Sqlite--netstandard2.0-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sqlite\Extension.cs", "region": { @@ -41,7 +41,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'configuration' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'configuration' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sqlite\Snapshot\SqliteSnapshotStore.cs", "region": { diff --git a/analyzers/its/expected/akka.net/Akka.Persistence.TestKit--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Persistence.TestKit--netstandard2.0-S3900.json index 33a73af925a..bc8a3c1c4d1 100644 --- a/analyzers/its/expected/akka.net/Akka.Persistence.TestKit--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Persistence.TestKit--netstandard2.0-S3900.json @@ -2,19 +2,6 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'messages' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Persistence.TestKit\Journal\TestJournal.cs", -"region": { -"startLine": 48, -"startColumn": 31, -"endLine": 48, -"endColumn": 39 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'metadata' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Persistence.TestKit\SnapshotStore\TestSnapshotStore.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Remote--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Remote--netstandard2.0-S3900.json index 534e5c4ef06..b90ca2fb945 100644 --- a/analyzers/its/expected/akka.net/Akka.Remote--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Remote--netstandard2.0-S3900.json @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\AkkaProtocolSettings.cs", "region": { @@ -93,7 +93,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\PhiAccrualFailureDetector.cs", "region": { @@ -106,7 +106,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'path' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'path' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\RemoteActorRef.cs", "region": { @@ -145,7 +145,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\RemoteActorRefProvider.cs", "region": { @@ -249,7 +249,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\RemoteSettings.cs", "region": { @@ -275,7 +275,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\RemoteSettings.cs", "region": { @@ -301,6 +301,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'watcher' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Remote\RemoteWatcher.cs", +"region": { +"startLine": 533, +"startColumn": 49, +"endLine": 533, +"endColumn": 56 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'watchee' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\RemoteWatcher.cs", @@ -340,6 +353,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'watcher' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Remote\RemoteWatcher.cs", +"region": { +"startLine": 575, +"startColumn": 39, +"endLine": 575, +"endColumn": 46 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'watchee' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\RemoteWatcher.cs", @@ -574,6 +600,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Remote\Transport\Transport.cs", +"region": { +"startLine": 412, +"startColumn": 17, +"endLine": 412, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'other' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote\Transport\Transport.cs", diff --git a/analyzers/its/expected/akka.net/Akka.Remote.TestKit--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Remote.TestKit--netstandard2.0-S3900.json index 5d7f8821a69..3d51df508f7 100644 --- a/analyzers/its/expected/akka.net/Akka.Remote.TestKit--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Remote.TestKit--netstandard2.0-S3900.json @@ -2,7 +2,20 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Remote.TestKit\DataTypes.cs", +"region": { +"startLine": 27, +"startColumn": 40, +"endLine": 27, +"endColumn": 45 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote.TestKit\Extension.cs", "region": { @@ -15,7 +28,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote.TestKit\Extension.cs", "region": { @@ -67,7 +80,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'myself' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'myself' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote.TestKit\MultiNodeSpec.cs", "region": { @@ -93,19 +106,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'messageClasses' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Remote.TestKit\MultiNodeSpec.cs", -"region": { -"startLine": 552, -"startColumn": 44, -"endLine": 552, -"endColumn": 58 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'tc' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Remote.TestKit\MultiNodeSpec.cs", @@ -116,19 +116,6 @@ "endColumn": 29 } } -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'names' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Remote.TestKit\Player.cs", -"region": { -"startLine": 127, -"startColumn": 34, -"endLine": 127, -"endColumn": 39 -} -} } ] } 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 59f518135ef..bc52abbe402 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 @@ -2,7 +2,7 @@ "issues": [ { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.Hyperion\HyperionSerializer.cs", "region": { @@ -15,6 +15,19 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", +"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.Serialization.TestKit--net471-S3900.json b/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--net471-S3900.json index f2fabd0650f..5bf647a9c60 100644 --- a/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--net471-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--net471-S3900.json @@ -15,7 +15,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nonConventionalArg' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessage.cs", +"region": { +"startLine": 31, +"startColumn": 17, +"endLine": 31, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'nonConventionalArg' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessage.cs", "region": { @@ -41,7 +54,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nonConventionalArg' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessageWithPrivateCtor.cs", +"region": { +"startLine": 30, +"startColumn": 17, +"endLine": 30, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'nonConventionalArg' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessageWithPrivateCtor.cs", "region": { @@ -51,6 +77,32 @@ "endColumn": 37 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\UntypedContainerMessage.cs", +"region": { +"startLine": 18, +"startColumn": 37, +"endLine": 18, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\UntypedContainerMessage.cs", +"region": { +"startLine": 25, +"startColumn": 17, +"endLine": 25, +"endColumn": 20 +} +} } ] } diff --git a/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--net5.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--net5.0-S3900.json index f2fabd0650f..5bf647a9c60 100644 --- a/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--net5.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--net5.0-S3900.json @@ -15,7 +15,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nonConventionalArg' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessage.cs", +"region": { +"startLine": 31, +"startColumn": 17, +"endLine": 31, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'nonConventionalArg' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessage.cs", "region": { @@ -41,7 +54,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nonConventionalArg' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessageWithPrivateCtor.cs", +"region": { +"startLine": 30, +"startColumn": 17, +"endLine": 30, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'nonConventionalArg' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessageWithPrivateCtor.cs", "region": { @@ -51,6 +77,32 @@ "endColumn": 37 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\UntypedContainerMessage.cs", +"region": { +"startLine": 18, +"startColumn": 37, +"endLine": 18, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\UntypedContainerMessage.cs", +"region": { +"startLine": 25, +"startColumn": 17, +"endLine": 25, +"endColumn": 20 +} +} } ] } diff --git a/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--netcoreapp3.1-S3900.json b/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--netcoreapp3.1-S3900.json index f2fabd0650f..5bf647a9c60 100644 --- a/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--netcoreapp3.1-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Serialization.TestKit--netcoreapp3.1-S3900.json @@ -15,7 +15,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nonConventionalArg' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessage.cs", +"region": { +"startLine": 31, +"startColumn": 17, +"endLine": 31, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'nonConventionalArg' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessage.cs", "region": { @@ -41,7 +54,20 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'nonConventionalArg' before using it.", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessageWithPrivateCtor.cs", +"region": { +"startLine": 30, +"startColumn": 17, +"endLine": 30, +"endColumn": 20 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'nonConventionalArg' because it could be null.", "location": { "uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\ImmutableMessageWithPrivateCtor.cs", "region": { @@ -51,6 +77,32 @@ "endColumn": 37 } } +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\UntypedContainerMessage.cs", +"region": { +"startLine": 18, +"startColumn": 37, +"endLine": 18, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'obj' before using it.", +"location": { +"uri": "sources\akka.net\src\contrib\serializers\Akka.Serialization.TestKit\UntypedContainerMessage.cs", +"region": { +"startLine": 25, +"startColumn": 17, +"endLine": 25, +"endColumn": 20 +} +} } ] } 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 64779f12701..31c13fd009d 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 @@ -28,7 +28,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'info' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'info' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\ActorMaterializer.cs", "region": { @@ -84,6 +84,45 @@ "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Attributes.cs", "region": { +"startLine": 67, +"startColumn": 94, +"endLine": 67, +"endColumn": 99 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Attributes.cs", +"region": { +"startLine": 113, +"startColumn": 35, +"endLine": 113, +"endColumn": 40 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Attributes.cs", +"region": { +"startLine": 176, +"startColumn": 37, +"endLine": 176, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Attributes.cs", +"region": { "startLine": 409, "startColumn": 18, "endLine": 409, @@ -106,6 +145,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'other' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Attributes.cs", +"region": { +"startLine": 563, +"startColumn": 37, +"endLine": 563, +"endColumn": 42 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'creator' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\CodeGen\Dsl\UnzipWith.cs", @@ -327,19 +379,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'graph' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Dsl\Flow.cs", -"region": { -"startLine": 477, -"startColumn": 76, -"endLine": 477, -"endColumn": 81 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'flow' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Dsl\FlowWithContextOperations.cs", @@ -1068,19 +1107,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'g' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Dsl\RunnableGraph.cs", -"region": { -"startLine": 163, -"startColumn": 68, -"endLine": 163, -"endColumn": 69 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'graph' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Dsl\Sink.cs", @@ -1133,19 +1159,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'source' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Dsl\Source.cs", -"region": { -"startLine": 518, -"startColumn": 65, -"endLine": 518, -"endColumn": 71 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'props' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Dsl\Source.cs", @@ -1172,7 +1185,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'registered' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'registered' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\FanInShape.cs", "region": { @@ -1198,32 +1211,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'outlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\FanInShape.cs", -"region": { -"startLine": 194, -"startColumn": 17, -"endLine": 194, -"endColumn": 24 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'inlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\FanInShape.cs", -"region": { -"startLine": 195, -"startColumn": 17, -"endLine": 195, -"endColumn": 23 -} -} -}, -{ -"id": "S3900", "message": "Refactor this constructor to avoid using members of parameter 'inlets' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\FanInShape.cs", @@ -1237,7 +1224,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'registered' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'registered' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\FanOutShape.cs", "region": { @@ -1263,32 +1250,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'inlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\FanOutShape.cs", -"region": { -"startLine": 189, -"startColumn": 17, -"endLine": 189, -"endColumn": 23 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'outlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\FanOutShape.cs", -"region": { -"startLine": 191, -"startColumn": 17, -"endLine": 191, -"endColumn": 24 -} -} -}, -{ -"id": "S3900", "message": "Refactor this constructor to avoid using members of parameter 'outlets' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\FanOutShape.cs", @@ -1367,7 +1328,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\FanIn.cs", "region": { @@ -1393,7 +1354,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\FanOut.cs", "region": { @@ -1432,7 +1393,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'shape' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'shape' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\ActorGraphInterpreter.cs", "region": { @@ -1445,7 +1406,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'settings' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'settings' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\ActorGraphInterpreter.cs", "region": { @@ -1458,7 +1419,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'assembly' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'assembly' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\ActorGraphInterpreter.cs", "region": { @@ -1471,7 +1432,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'shell' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'shell' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\ActorGraphInterpreter.cs", "region": { @@ -1510,7 +1471,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'inlets' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'inlets' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphAssembly.cs", "region": { @@ -1523,7 +1484,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'inletOwners' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'inletOwners' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphAssembly.cs", "region": { @@ -1536,7 +1497,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'outlets' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'outlets' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphAssembly.cs", "region": { @@ -1549,7 +1510,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'outletOwners' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'outletOwners' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphAssembly.cs", "region": { @@ -1562,6 +1523,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'register' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphAssembly.cs", +"region": { +"startLine": 208, +"startColumn": 21, +"endLine": 208, +"endColumn": 29 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'inheritedAttributes' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphAssembly.cs", @@ -1601,6 +1575,19 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'assembly' because it could be null.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphInterpreter.cs", +"region": { +"startLine": 459, +"startColumn": 40, +"endLine": 459, +"endColumn": 48 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'logic' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphInterpreter.cs", @@ -1679,6 +1666,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'handler' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphInterpreter.cs", +"region": { +"startLine": 805, +"startColumn": 25, +"endLine": 805, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'logic' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\GraphInterpreter.cs", @@ -1931,9 +1931,9 @@ "uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Stages\Stages.cs", "region": { "startLine": 448, -"startColumn": 83, +"startColumn": 105, "endLine": 448, -"endColumn": 96 +"endColumn": 118 } } }, @@ -2134,7 +2134,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'system' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'system' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Serialization\StreamRefSerializer.cs", "region": { @@ -2173,32 +2173,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'inlet' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 57, -"startColumn": 92, -"endLine": 57, -"endColumn": 97 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'outlet' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 122, -"startColumn": 98, -"endLine": 122, -"endColumn": 104 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'shape' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", @@ -2225,84 +2199,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'inlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 381, -"startColumn": 17, -"endLine": 381, -"endColumn": 23 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'outlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 383, -"startColumn": 17, -"endLine": 383, -"endColumn": 24 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'inlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 489, -"startColumn": 17, -"endLine": 489, -"endColumn": 23 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'outlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 491, -"startColumn": 17, -"endLine": 491, -"endColumn": 24 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'outlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 550, -"startColumn": 17, -"endLine": 550, -"endColumn": 24 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'inlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 552, -"startColumn": 17, -"endLine": 552, -"endColumn": 23 -} -} -}, -{ -"id": "S3900", "message": "Refactor this constructor to avoid using members of parameter 'top' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", @@ -2329,32 +2225,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'inlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 668, -"startColumn": 17, -"endLine": 668, -"endColumn": 23 -} -} -}, -{ -"id": "S3900", -"message": "Refactor this method to add validation of parameter 'outlets' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", -"region": { -"startLine": 669, -"startColumn": 17, -"endLine": 669, -"endColumn": 24 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'top' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Shape.cs", @@ -2381,7 +2251,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'stageAttributes' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'stageAttributes' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Stage\AbstractStage.cs", "region": { @@ -2498,7 +2368,33 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'logic' before using it.", +"message": "Refactor this method to add validation of parameter 'andThen' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Stage\GraphStage.cs", +"region": { +"startLine": 1468, +"startColumn": 25, +"endLine": 1468, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'andThen' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Stage\GraphStage.cs", +"region": { +"startLine": 1475, +"startColumn": 17, +"endLine": 1475, +"endColumn": 24 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'logic' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Stage\GraphStage.cs", "region": { @@ -2511,7 +2407,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'logic' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'logic' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Stage\GraphStage.cs", "region": { @@ -2524,6 +2420,45 @@ }, { "id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'getAsyncCallback' because it could be null.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Stage\GraphStage.cs", +"region": { +"startLine": 2385, +"startColumn": 25, +"endLine": 2385, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this constructor to avoid using members of parameter 'materializer' because it could be null.", +"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 constructor to avoid using members of parameter 'materializer' because it could be null.", +"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", @@ -2719,19 +2654,6 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'cause' before using it.", -"location": { -"uri": "sources\akka.net\src\core\Akka.Streams\Transformer.cs", -"region": { -"startLine": 103, -"startColumn": 19, -"endLine": 103, -"endColumn": 24 -} -} -}, -{ -"id": "S3900", "message": "Refactor this method to add validation of parameter 'type' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Streams\Util\TypeExtensions.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 c5ed0c6c72d..5f71960e899 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,6 +51,19 @@ "endColumn": 26 } } +}, +{ +"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 88a8b43ff90..3ee520c7946 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 @@ -28,6 +28,32 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'func' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\EventFilter\Internal\EventFilterApplier.cs", +"region": { +"startLine": 289, +"startColumn": 30, +"endLine": 289, +"endColumn": 34 +} +} +}, +{ +"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": 293, +"startColumn": 48, +"endLine": 293, +"endColumn": 67 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'system' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.TestKit\EventFilter\Internal\EventFilterApplier.cs", @@ -41,6 +67,58 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'func' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\EventFilter\Internal\EventFilterApplier.cs", +"region": { +"startLine": 352, +"startColumn": 36, +"endLine": 352, +"endColumn": 40 +} +} +}, +{ +"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": 356, +"startColumn": 48, +"endLine": 356, +"endColumn": 67 +} +} +}, +{ +"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", @@ -145,6 +223,110 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'testActorRef' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRef.cs", +"region": { +"startLine": 42, +"startColumn": 20, +"endLine": 42, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'testActorRef' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRef.cs", +"region": { +"startLine": 54, +"startColumn": 21, +"endLine": 54, +"endColumn": 33 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'testActorRef' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRef.cs", +"region": { +"startLine": 66, +"startColumn": 20, +"endLine": 66, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'testActorRef' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRef.cs", +"region": { +"startLine": 78, +"startColumn": 21, +"endLine": 78, +"endColumn": 33 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'testActorRef' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRefBase.cs", +"region": { +"startLine": 181, +"startColumn": 20, +"endLine": 181, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'testActorRef' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRefBase.cs", +"region": { +"startLine": 193, +"startColumn": 21, +"endLine": 193, +"endColumn": 33 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'testActorRef' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRefBase.cs", +"region": { +"startLine": 205, +"startColumn": 20, +"endLine": 205, +"endColumn": 32 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'testActorRef' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRefBase.cs", +"region": { +"startLine": 217, +"startColumn": 21, +"endLine": 217, +"endColumn": 33 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'actorRef' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.TestKit\TestActorRefBase.cs", @@ -158,7 +340,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'testKit' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'testKit' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.TestKit\TestBarrier.cs", "region": { @@ -223,6 +405,149 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 'assertion' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_AwaitAssert.cs", +"region": { +"startLine": 46, +"startColumn": 21, +"endLine": 46, +"endColumn": 30 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'assertion' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_AwaitAssert.cs", +"region": { +"startLine": 85, +"startColumn": 21, +"endLine": 85, +"endColumn": 30 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'assertion' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_AwaitAssert.cs", +"region": { +"startLine": 124, +"startColumn": 27, +"endLine": 124, +"endColumn": 36 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'conditionIsFulfilled' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_AwaitConditions.cs", +"region": { +"startLine": 358, +"startColumn": 21, +"endLine": 358, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'fail' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_AwaitConditions.cs", +"region": { +"startLine": 366, +"startColumn": 21, +"endLine": 366, +"endColumn": 25 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'conditionIsFulfilled' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_AwaitConditions.cs", +"region": { +"startLine": 386, +"startColumn": 21, +"endLine": 386, +"endColumn": 41 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'fail' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_AwaitConditions.cs", +"region": { +"startLine": 394, +"startColumn": 21, +"endLine": 394, +"endColumn": 25 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'filter' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_Receive.cs", +"region": { +"startLine": 249, +"startColumn": 30, +"endLine": 249, +"endColumn": 36 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'shouldIgnore' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_Receive.cs", +"region": { +"startLine": 310, +"startColumn": 25, +"endLine": 310, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'function' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_Within.cs", +"region": { +"startLine": 134, +"startColumn": 23, +"endLine": 134, +"endColumn": 31 +} +} +}, +{ +"id": "S3900", +"message": "Refactor this method to add validation of parameter 'function' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase_Within.cs", +"region": { +"startLine": 196, +"startColumn": 29, +"endLine": 196, +"endColumn": 37 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'system' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.TestKit\TestKitExtension.cs", @@ -249,7 +574,7 @@ }, { "id": "S3900", -"message": "Refactor this method to add validation of parameter 'config' before using it.", +"message": "Refactor this constructor to avoid using members of parameter 'config' because it could be null.", "location": { "uri": "sources\akka.net\src\core\Akka.TestKit\TestKitSettings.cs", "region": { diff --git a/analyzers/its/expected/akka.net/Akka.Tests.Shared.Internals--netstandard2.0-S3900.json b/analyzers/its/expected/akka.net/Akka.Tests.Shared.Internals--netstandard2.0-S3900.json index 2174d66034e..c7f7fc6392d 100644 --- a/analyzers/its/expected/akka.net/Akka.Tests.Shared.Internals--netstandard2.0-S3900.json +++ b/analyzers/its/expected/akka.net/Akka.Tests.Shared.Internals--netstandard2.0-S3900.json @@ -132,6 +132,19 @@ }, { "id": "S3900", +"message": "Refactor this method to add validation of parameter 's' before using it.", +"location": { +"uri": "sources\akka.net\src\core\Akka.Tests.Shared.Internals\AkkaSpecExtensions.cs", +"region": { +"startLine": 188, +"startColumn": 50, +"endLine": 188, +"endColumn": 51 +} +} +}, +{ +"id": "S3900", "message": "Refactor this method to add validation of parameter 'start' before using it.", "location": { "uri": "sources\akka.net\src\core\Akka.Tests.Shared.Internals\AkkaSpecExtensions.cs", diff --git a/analyzers/src/SonarAnalyzer.CFG/ShimLayer/SyntaxKindEx.cs b/analyzers/src/SonarAnalyzer.CFG/ShimLayer/SyntaxKindEx.cs index fec7e0ca6e9..e354172ee95 100644 --- a/analyzers/src/SonarAnalyzer.CFG/ShimLayer/SyntaxKindEx.cs +++ b/analyzers/src/SonarAnalyzer.CFG/ShimLayer/SyntaxKindEx.cs @@ -14,6 +14,7 @@ public static class SyntaxKindEx public const SyntaxKind InitKeyword = (SyntaxKind)8443; public const SyntaxKind ManagedKeyword = (SyntaxKind)8445; public const SyntaxKind UnmanagedKeyword = (SyntaxKind)8446; + public const SyntaxKind FileKeyword = (SyntaxKind)8449; public const SyntaxKind NullableKeyword = (SyntaxKind)8486; public const SyntaxKind EnableKeyword = (SyntaxKind)8487; public const SyntaxKind WarningsKeyword = (SyntaxKind)8488; diff --git a/analyzers/src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs b/analyzers/src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs index af666a2a958..64029a03bf9 100644 --- a/analyzers/src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs +++ b/analyzers/src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs @@ -19,6 +19,9 @@ */ using SonarAnalyzer.SymbolicExecution.Constraints; +using static Microsoft.CodeAnalysis.Accessibility; +using static Microsoft.CodeAnalysis.CSharp.SyntaxKind; +using static StyleCop.Analyzers.Lightup.SyntaxKindEx; namespace SonarAnalyzer.SymbolicExecution.Roslyn.RuleChecks.CSharp; @@ -31,8 +34,40 @@ public class PublicMethodArgumentsShouldBeCheckedForNull : SymbolicRuleCheck protected override DiagnosticDescriptor Rule => S3900; - public override bool ShouldExecute() => - Node is BaseMethodDeclarationSyntax or AccessorDeclarationSyntax; + public override bool ShouldExecute() + { + return (IsRelevantMethod() || IsRelevantPropertyAccessor()) + && IsAccessibleFromOtherAssemblies(); + + bool IsRelevantMethod() => + Node is BaseMethodDeclarationSyntax { } method && MethodDereferencesArguments(method); + + bool IsRelevantPropertyAccessor() => + Node is AccessorDeclarationSyntax { } accessor + && (!accessor.Keyword.IsKind(GetKeyword) || accessor.Parent.Parent is IndexerDeclarationSyntax); + + bool IsAccessibleFromOtherAssemblies() => + SemanticModel.GetDeclaredSymbol(Node).GetEffectiveAccessibility() is Public or Protected or ProtectedOrInternal; + + static bool MethodDereferencesArguments(BaseMethodDeclarationSyntax method) + { + var argumentNames = method.ParameterList.Parameters + .Where(x => !x.Modifiers.AnyOfKind(OutKeyword)) + .Select(x => x.GetName()) + .ToHashSet(); + + if (argumentNames.Any()) + { + var walker = new ArgumentDereferenceWalker(argumentNames); + walker.SafeVisit(method); + return walker.DereferencesMethodArguments; + } + else + { + return false; + } + } + } protected override ProgramState PreProcessSimple(SymbolicContext context) { @@ -65,4 +100,32 @@ private static bool IsParameterDereferenced(IOperationWrapperSonar operation) => OperationKindEx.EventReference, OperationKindEx.Await, OperationKindEx.ArrayElementReference); + + private sealed class ArgumentDereferenceWalker : SafeCSharpSyntaxWalker + { + private readonly ISet argumentNames; + + public bool DereferencesMethodArguments { get; private set; } + + public ArgumentDereferenceWalker(ISet argumentNames) => + this.argumentNames = argumentNames; + + public override void Visit(SyntaxNode node) + { + if (!DereferencesMethodArguments && !node.IsAnyKind(LocalFunctionStatement, SimpleLambdaExpression, ParenthesizedLambdaExpression)) + { + base.Visit(node); + } + } + + public override void VisitIdentifierName(IdentifierNameSyntax node) => + DereferencesMethodArguments |= + argumentNames.Contains(node.GetName()) + && node.Parent.IsAnyKind( + AwaitExpression, + ElementAccessExpression, + ForEachStatement, + ThrowStatement, + SimpleMemberAccessExpression); + } } diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp11.cs b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp11.cs index c2a73fa26fc..2b82ed9c8c2 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp11.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp11.cs @@ -32,3 +32,27 @@ public static virtual void NotCompliantCases(object o) o.ToString(); // Noncompliant {{Refactor this method to add validation of parameter 'o' before using it.}} } } + +file class ClassWithFileAccessibility +{ + public void PublicWithArgs(object o) + { + o.ToString(); // Compliant - method is not accessible from other assemblies + } +} + +file interface IInterfaceWithFileAccessibility +{ + void PublicWithArgs(object o) + { + o.ToString(); + } +} + +file struct StructWithFileAccessibility +{ + public void PublicWithArgs(object o) + { + o.ToString(); + } +} diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp8.cs b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp8.cs index 33651b4f160..03750379162 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp8.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp8.cs @@ -192,3 +192,23 @@ public void Test(string s) } } } + +public class ClassAccessibility +{ + private protected void PrivateProtectedWithArgs(object o) + { + o.ToString(); // Compliant - method is not accessible from other assemblies + } + + private protected object PrivateProtectedProperty + { + get => null; + set => _ = value.ToString(); // Compliant - property is not accessible from other assemblies + } + + public object PrivateProtectedSetter + { + get => null; + private protected set => _ = value.ToString(); // Compliant - setter is not accessible from other assemblies + } +} diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp9.cs b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp9.cs index f49a383b604..6a9ed6e9a06 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp9.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.CSharp9.cs @@ -49,15 +49,14 @@ public void PatternMatching(object arg) } } - public void StaticLambda() + public void StaticLambdas() { - Func a = static (arg) => - { - return arg.ToString(); // Compliant, it's not a public method argument - }; - a(null); + MethodAcceptsFunction(static obj => obj.ToString()); + MethodAcceptsFunction(static (obj) => obj.ToString()); } + private void MethodAcceptsFunction(Action action) { } + public object PropertySet { get => null; diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs index 52f92e1759a..8ca43946631 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/TestCases/SymbolicExecution/Roslyn/PublicMethodArgumentsShouldBeCheckedForNull.cs @@ -25,7 +25,7 @@ protected void NotCompliantCases_Protected(object o) private void CompliantCases_Private(object o) { - o.ToString(); // Noncompliant - FP (method visibility) + o.ToString(); // Compliant - not accessible from other assemblies } protected internal void NotCompliantCases_ProtectedInternal(object o) @@ -35,7 +35,7 @@ protected internal void NotCompliantCases_ProtectedInternal(object o) internal void CompliantCases_Internal(object o) { - o.ToString(); // Noncompliant - FP (method visibility) + o.ToString(); // Compliant - not accessible from other assemblies } public void CompliantCases(bool b, object o1, object o2, object o3, object o4, Exception e) @@ -395,7 +395,7 @@ public void ReassignedFromConstructor(StringBuilder parameter) public void ReassignedFromMethodOut(out StringBuilder parameter) { parameter = Create(); - parameter.Capacity = 1; // Noncompliant - FP + parameter.Capacity = 1; } public void ReassignedFromConstructorOut(out StringBuilder parameter) @@ -406,3 +406,224 @@ public void ReassignedFromConstructorOut(out StringBuilder parameter) private StringBuilder Create() => null; } + +public class ClassAccessibility +{ + private object field = null; + + public void PublicWithoutArgs() + { + field.ToString(); // Compliant - not a method argument + } + + public void PublicWithArgs(object o) + { + o.ToString(); // Noncompliant + } + + protected void ProtectedWithArgs(object o) + { + o.ToString(); // Noncompliant + } + + protected internal void ProtectedInternalWithArgs(object o) + { + o.ToString(); // Noncompliant + } + + internal void InternalWithArgs(object o) + { + o.ToString(); // Compliant - method is not accessible from other assemblies + } + + private void PrivateWithArgs(object o) + { + o.ToString(); + } + + void ImplicitlyPrivateWithArgs(object o) + { + o.ToString(); // Compliant + } +} + +public struct StructAccessibility +{ + private object field; + + public void PublicWithoutArgs() + { + field.ToString(); // Compliant - not a method argument + } + + public void PublicWithArgs(object o) + { + o.ToString(); // Noncompliant + } + + internal void InternalWithArgs(object o) + { + o.ToString(); // Compliant - method is not accessible from other assemblies + } + + void ImplicitlyInternalWithArgs(object o) + { + o.ToString(); + } + + private void PrivateWithArgs(object o) + { + o.ToString(); + } + + public void LambdasAndAnonymousDelegates() + { + MethodAcceptsFunction(obj => obj.ToString()); + MethodAcceptsFunction((obj) => obj.ToString()); + MethodAcceptsFunction(delegate (object obj) { obj.ToString(); }); + } + + private void MethodAcceptsFunction(Action action) { } +} + +public class PropertyAccessibility +{ + public object PublicProperty + { + get => null; + set => _ = value.ToString(); // Noncompliant + } + + protected object ProtectedProperty + { + get => null; + set => _ = value.ToString(); // Noncompliant + } + + protected internal object ProtectedInternalProperty + { + get => null; + set => _ = value.ToString(); // Noncompliant + } + + internal object InternalProperty + { + get => null; + set => _ = value.ToString(); + } + + private object PrivateProperty + { + get => null; + set => _ = value.ToString(); + } + + object ImplicitlyPrivateProperty + { + get => null; + set => _ = value.ToString(); + } + + public object ProtectedSetter + { + get => null; + protected set => _ = value.ToString(); // Noncompliant + } + + public object ProtectedInternalSetter + { + get => null; + protected internal set => _ = value.ToString(); // Noncompliant + } + + public object InternalSetter + { + get => null; + internal set => _ = value.ToString(); // Compliant - setter is not accessible from other assemblies + } + + public object PrivateSetter + { + get => null; + private set => _ = value.ToString(); + } +} + +public class ClassWithIndexer +{ + public string this[object index] + { + get { return index.ToString(); } // Noncompliant + set { _ = value.ToString(); } // Noncompliant + } +} + +public class ClassWithEvent +{ + public event EventHandler CustomEvent; + + public void Method(ClassWithEvent c) + { + c.CustomEvent += (sender, args) // Noncompliant + => Console.WriteLine(); + } +} + +internal class InternalClass +{ + public void PublicWithArgs(object o) + { + o.ToString(); // Compliant - method is not accessible from other assemblies + } +} + +class ImplicitlyInternalClass +{ + public void PublicWithArgs(object o) + { + o.ToString(); + } +} + +public class NestedClasses +{ + public class PublicNestedClass + { + public void Method(object o) + { + o.ToString(); // Noncompliant + } + + private class DeeperNestedPrivateClass + { + public void Method(object o) + { + o.ToString(); // Compliant - method is not accessible from other assemblies + } + } + } + + protected class ProtectedNestedClass + { + public void Method(object o) + { + o.ToString(); // Noncompliant + } + } + + private class PrivateNestedClass + { + public void Method(object o) + { + o.ToString(); // Compliant - method is not accessible from other assemblies + } + + public class DeeperNestedPublicClass + { + public void Method(object o) + { + o.ToString(); // Compliant - method is not accessible from other assemblies + } + } + } +}