Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S3254 FN: primary constructors #8222

Merged
merged 13 commits into from
Oct 26, 2023
Merged
78 changes: 78 additions & 0 deletions analyzers/its/expected/Nancy/Nancy--net452-S3254.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,58 @@
"issues": [
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'lifetime'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/Bootstrapper/NancyBootstrapperWithRequestContainerBase.cs#L125",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TP: Constructor:

.Select(tr => new TypeRegistration(tr.RegistrationType, tr.ImplementationType, Lifetime.Singleton)))

"region": {
"startLine": 125,
"startColumn": 104,
"endLine": 125,
"endColumn": 122
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'lifetime'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/Bootstrapper/NancyBootstrapperWithRequestContainerBase.cs#L134",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TP: Constructor

.Select(tr => new CollectionTypeRegistration(tr.RegistrationType, tr.ImplementationTypes, Lifetime.Singleton)))

"region": {
"startLine": 134,
"startColumn": 145,
"endLine": 134,
"endColumn": 163
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'disableMethodNotAllowedResponses'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/RouteConfiguration.cs#L12",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TP: Constructor:

public static readonly RouteConfiguration Default = new RouteConfiguration(
disableMethodNotAllowedResponses: false,

"region": {
"startLine": 12,
"startColumn": 13,
"endLine": 12,
"endColumn": 52
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'explicitHeadRouting'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/RouteConfiguration.cs#L13",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TP: Constructor

public static readonly RouteConfiguration Default = new RouteConfiguration(
disableMethodNotAllowedResponses: false,
explicitHeadRouting: false);

"region": {
"startLine": 13,
"startColumn": 13,
"endLine": 13,
"endColumn": 39
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'httpsPort'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/Security/ModuleSecurity.cs#L84",
Expand All @@ -12,6 +64,32 @@
"endColumn": 92
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'runtimeViewDiscovery'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/ViewConfiguration.cs#L12",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TP: Constructor

public static readonly ViewConfiguration Default = new ViewConfiguration(
runtimeViewDiscovery: false,
runtimeViewUpdates: false);

"region": {
"startLine": 12,
"startColumn": 13,
"endLine": 12,
"endColumn": 40
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'runtimeViewUpdates'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/ViewConfiguration.cs#L13",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

"region": {
"startLine": 13,
"startColumn": 13,
"endLine": 13,
"endColumn": 38
}
}
}
]
}
78 changes: 78 additions & 0 deletions analyzers/its/expected/Nancy/Nancy--netstandard2.0-S3254.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,58 @@
"issues": [
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'lifetime'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/Bootstrapper/NancyBootstrapperWithRequestContainerBase.cs#L125",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.Select(tr => new TypeRegistration(tr.RegistrationType, tr.ImplementationType, Lifetime.Singleton)))

"region": {
"startLine": 125,
"startColumn": 104,
"endLine": 125,
"endColumn": 122
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'lifetime'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/Bootstrapper/NancyBootstrapperWithRequestContainerBase.cs#L134",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

"region": {
"startLine": 134,
"startColumn": 145,
"endLine": 134,
"endColumn": 163
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'disableMethodNotAllowedResponses'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/RouteConfiguration.cs#L12",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static readonly RouteConfiguration Default = new RouteConfiguration(
disableMethodNotAllowedResponses: false,
explicitHeadRouting: false);

"region": {
"startLine": 12,
"startColumn": 13,
"endLine": 12,
"endColumn": 52
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'explicitHeadRouting'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/RouteConfiguration.cs#L13",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

"region": {
"startLine": 13,
"startColumn": 13,
"endLine": 13,
"endColumn": 39
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'httpsPort'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/Security/ModuleSecurity.cs#L84",
Expand All @@ -12,6 +64,32 @@
"endColumn": 92
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'runtimeViewDiscovery'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/ViewConfiguration.cs#L12",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

"region": {
"startLine": 12,
"startColumn": 13,
"endLine": 12,
"endColumn": 40
}
}
},
{
"id": "S3254",
"message": "Remove this default value assigned to parameter 'runtimeViewUpdates'.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/ViewConfiguration.cs#L13",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

"region": {
"startLine": 13,
"startColumn": 13,
"endLine": 13,
"endColumn": 38
}
}
}
]
}
Loading