All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.plugins.csharp.S3254.html Maven / Gradle / Ivy

There is a newer version: 10.2.0.105762
Show newest version

Why is this an issue?

Specifying the default parameter values in a method call is redundant. Such values should be omitted in the interests of readability.

Noncompliant code example

public void M(int x, int y=5, int z = 7) { /* ... */ }

// ...
M(1, 5); // Noncompliant, y has the default value
M(1, z: 7); // Noncompliant, z has the default value

Compliant solution

public void M(int x, int y=5, int z = 7) { /* ... */ }

// ...
M(1);
M(1);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy