rspec/rules/S107/csharp/rule.adoc

64 lines
1.1 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 10:16:44 +02:00
include::../description.adoc[]
=== Noncompliant code example
2020-06-30 10:16:44 +02:00
With a maximum number of 4 parameters:
2022-02-04 17:28:24 +01:00
[source,csharp]
2020-06-30 10:16:44 +02:00
----
public void doSomething(int param1, int param2, int param3, string param4, long param5)
2020-06-30 10:16:44 +02:00
{
// ...
2020-06-30 10:16:44 +02:00
}
----
=== Compliant solution
2020-06-30 10:16:44 +02:00
2022-02-04 17:28:24 +01:00
[source,csharp]
2020-06-30 10:16:44 +02:00
----
public void doSomething(int param1, int param2, int param3, string param4)
2020-06-30 10:16:44 +02:00
{
// ...
2020-06-30 10:16:44 +02:00
}
----
=== Exceptions
[source,csharp]
----
public class BaseClass
{
public BaseClass(int param1)
{
// ...
}
}
public class DerivedClass : BaseClass
{
public DerivedClass(int param1, int param2, int param3, string param4, long param5) : base(param1) // Compliant, the parameters intended for the base class constructor do not count in the sum of the parameter list.
{
// ...
}
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::../parameters.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]