Stop Keyword

Locates 'Stop' instructions in user code.

Reasoning

While a great debugging tool, 'Stop' instructions should not be reachable in production code; this inspection makes it easy to locate them all.

Default severity

Suggestion

Inspection type

CodeQualityIssues

Examples

This example should trigger a result

MyModule (StandardModule)
Public Sub DoSomething() ' ... Stop ' halts execution on-the-spot, bringing up the VBE; not very user-friendly! '.... End Sub

This example should NOT trigger a result

MyModule (StandardModule)
Public Sub DoSomething() ' ... 'Stop ' the commented-out statement isn't executable. Could also be simply removed. ' ... End Sub

Rubberduck.CodeAnalysis.Inspections.Concrete.StopKeywordInspection.cs (Prerelease-v2.5.9.6289)