|
14 | 14 |
|
15 | 15 | namespace Rubberduck.CodeAnalysis.Inspections.Concrete
|
16 | 16 | {
|
| 17 | + /// <summary> |
| 18 | + /// Flags Interface implementation members and EventHandlers with Public scope. |
| 19 | + /// </summary> |
| 20 | + /// <why> |
| 21 | + /// The default (Public) interface of a class module should not expose the implementation of other interfaces or event handler procedures. |
| 22 | + /// If the implementation of an interface member or event handler is useful for a class to expose, it should do so using |
| 23 | + /// a dedicated Public member rather than changing the interface member or event handler scope from 'Private' to 'Public'. |
| 24 | + /// </why> |
| 25 | + /// <example hasResult="true"> |
| 26 | + /// <module name="MyClassModule" type="Class Module"> |
| 27 | + /// <![CDATA[ |
| 28 | + /// Implements ISomething 'ISomething defines procedure "DoSomething" |
| 29 | + /// |
| 30 | + /// Public Sub ISomething_DoSomething(ByVal someValue As Long) |
| 31 | + /// Debug.Print someValue |
| 32 | + /// End Sub |
| 33 | + /// ]]> |
| 34 | + /// </module> |
| 35 | + /// </example> |
| 36 | + /// <example hasResult="true"> |
| 37 | + /// <module name="MyClassModule" type="Class Module"> |
| 38 | + /// <![CDATA[ |
| 39 | + /// Private WithEvents abc As MyEvent 'MyEvent defines a "MyValueChanged" event |
| 40 | + /// |
| 41 | + /// Public Sub abc_MyValueChanged(ByVal newVal As Long) |
| 42 | + /// Debug.Print newVal |
| 43 | + /// End Sub |
| 44 | + /// ]]> |
| 45 | + /// </module> |
| 46 | + /// </example> |
| 47 | + /// <example hasResult="true"> |
| 48 | + /// <module name="MyClassModule" type="Class Module"> |
| 49 | + /// <![CDATA[ |
| 50 | + /// 'Code found in the "ThisWorkbook" Document |
| 51 | + /// Public Sub Workbook_Open() |
| 52 | + /// Debug.Print "Workbook was opened" |
| 53 | + /// End Sub |
| 54 | + /// ]]> |
| 55 | + /// </module> |
| 56 | + /// </example> |
| 57 | + /// <example hasResult="false"> |
| 58 | + /// <module name="MyClassModule" type="Class Module"> |
| 59 | + /// <![CDATA[ |
| 60 | + /// Implements ISomething 'ISomething defines procedure "DoSomething" |
| 61 | + /// |
| 62 | + /// Private Sub ISomething_DoSomething(ByVal someValue As Long) |
| 63 | + /// Debug.Print someValue |
| 64 | + /// End Sub |
| 65 | + /// ]]> |
| 66 | + /// </module> |
| 67 | + /// </example> |
| 68 | + /// <example hasResult="false"> |
| 69 | + /// <module name="MyClassModule" type="Class Module"> |
| 70 | + /// <![CDATA[ |
| 71 | + /// Public Sub Do_Something(ByVal someValue As Long) |
| 72 | + /// Debug.Print someValue |
| 73 | + /// End Sub |
| 74 | + /// ]]> |
| 75 | + /// </module> |
| 76 | + |
17 | 77 | internal sealed class PublicImplementationShouldBePrivateInspection : DeclarationInspectionBase
|
18 | 78 | {
|
19 | 79 | public PublicImplementationShouldBePrivateInspection(IDeclarationFinderProvider declarationFinderProvider)
|
|
0 commit comments