== Why is this an issue?

`Exit Function`, `Exit Property`, and `Exit Sub` are all poor, less-readable substitutes for a simple `Return`, and if used with code that should return a value (`Exit Function` and in some cases `Exit Property`) they could result in a `NullReferenceException`.

This rule raises an issue for all their usages.


=== Noncompliant code example

[source,vbnet]
----
Public Class Sample

  Public Sub MySub(Condition As Boolean)
    If Condition Then Exit Sub                  ' Noncompliant
    ' ...
  End Sub

  Public Function MyFunction(Condition As Boolean) As Integer
    If Condition Then
        MyFunction = 42
        Exit Function              ' Noncompliant
    End If
    ' ...
  End Function

End Class
----


=== Compliant solution

[source,vbnet]
----
Public Class Sample

  Public Sub MySub(Condition As Boolean)
    If Condition Then Return                  ' Noncompliant
    ' ...
  End Sub

  Public Function MyFunction(Condition As Boolean) As Integer
    If Condition Then Return 42
    ' ...
  End Function

End Class
----


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

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

=== Message

Remove this "Exit" statement.


=== Highlighting

Exit [xxx]


'''
== Comments And Links
(visible only on this page)

=== relates to: S1227

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