== Why is this an issue?

include::../description.adoc[]

=== Noncompliant code example

[source,csharp]
----
interface IMyInterface 
{
  int DoTheThing(); // Noncompliant - overloaded method declarations are not grouped together
  string DoTheOtherThing();
  int DoTheThing(string s);
}
----

=== Compliant solution

[source,csharp]
----
interface IMyInterface 
{
  int DoTheThing();
  int DoTheThing(string s);
  string DoTheOtherThing();
}
----

=== Exceptions

As it is common practice to group method declarations by implemented interface, no issue will be raised for implicit and explicit interface implementations if grouped together with other members of that interface.


As it is also a common practice to group method declarations by accessibility level, no issue will be raised for method overloads having different access modifiers.

Example:

[source,csharp]
----
class MyClass
{
  private void DoTheThing(string s) // Ok - this method is declared as private while the other one is public
  {
    // ...
  }

  private string DoTheOtherThing(string s)
  {
    // ...
  }

  public void DoTheThing()
  {
    // ...
  }
}
----
ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

include::../highlighting.adoc[]

endif::env-github,rspecator-view[]
