Skip to content

Commit 7223c41

Browse files
committed
Improve meta for default member inspections
1 parent ff60090 commit 7223c41

6 files changed

+35
-65
lines changed

Rubberduck.CodeAnalysis/Inspections/Concrete/ImplicitDefaultMemberAccessInspection.cs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Rubberduck.Inspections.Concrete
99
{
1010
/// <summary>
11-
/// Identifies the use non-indexed default member accesses.
11+
/// Identifies the use of non-indexed default member accesses.
1212
/// </summary>
1313
/// <why>
1414
/// Default member accesses hide away the actually called member. This is especially misleading if there is no indication in the expression that such a call is made
@@ -24,16 +24,8 @@ namespace Rubberduck.Inspections.Concrete
2424
/// </example>
2525
/// <example hasResult="true">
2626
/// <![CDATA[
27-
/// Class1:
28-
///
29-
/// Public Property Let Foo(RHS As Long)
30-
/// Attibute Foo.VB_UserMemId = 0
31-
/// End Function
32-
///
33-
/// Module:
34-
///
35-
/// Public Sub DoSomething(ByVal arg As Class1)
36-
/// Dim bar As Variant
27+
/// Public Sub DoSomething(ByVal arg As ADODB.Connection)
28+
/// Dim bar As String
3729
/// arg = bar
3830
/// End Sub
3931
/// ]]>
@@ -48,17 +40,9 @@ namespace Rubberduck.Inspections.Concrete
4840
/// </example>
4941
/// <example hasResult="false">
5042
/// <![CDATA[
51-
/// Class1:
52-
///
53-
/// Public Property Let Foo(RHS As Long)
54-
/// Attibute Foo.VB_UserMemId = 0
55-
/// End Function
56-
///
57-
/// Module:
58-
///
59-
/// Public Sub DoSomething(ByVal arg As Class1)
60-
/// Dim bar As Variant
61-
/// arg.Foo = bar
43+
/// Public Sub DoSomething(ByVal arg As ADODB.Connection)
44+
/// Dim bar As String
45+
/// arg.ConnectionString = bar
6246
/// End Sub
6347
/// ]]>
6448
public sealed class ImplicitDefaultMemberAccessInspection : IdentifierReferenceInspectionBase

Rubberduck.CodeAnalysis/Inspections/Concrete/ImplicitRecursiveDefaultMemberAccessInspection.cs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,59 +8,63 @@
88
namespace Rubberduck.Inspections.Concrete
99
{
1010
/// <summary>
11-
/// Identifies the use indexed default member accesses that require a recursive default member resolution.
11+
/// Identifies the use of indexed default member accesses that require a recursive default member resolution.
1212
/// </summary>
1313
/// <why>
1414
/// Default member accesses hide away the actually called member. This is especially misleading if there is no indication in the expression that such a call is made
1515
/// and the final default member is not on the interface of the object itself. In particular, this can cause errors in which a member was forgotten to be called to go unnoticed.
1616
/// </why>
1717
/// <example hasResult="true">
18+
/// <module name="Class1" type="Class Module">
1819
/// <![CDATA[
19-
/// Class1:
20-
///
2120
/// Public Function Foo() As Class2
2221
/// Attibute Foo.VB_UserMemId = 0
2322
/// Set Foo = New Class2
2423
/// End Function
25-
///
26-
/// Class2:
27-
///
24+
/// ]]>
25+
/// </module>
26+
/// <module name="Class2" type="Class Module">
27+
/// <![CDATA[
2828
/// Public Function Bar() As Long
2929
/// Attibute Bar.VB_UserMemId = 0
3030
/// Foo = 42
3131
/// End Function
32-
///
33-
/// Module:
34-
///
32+
/// ]]>
33+
/// </module>
34+
/// <module name="Module" type="Standard Module">
35+
/// <![CDATA[
3536
/// Public Sub DoSomething(ByVal arg As Class1)
3637
/// Dim bar As Variant
3738
/// bar = arg
3839
/// End Sub
3940
/// ]]>
41+
/// </module>
4042
/// </example>
4143
/// <example hasResult="false">
44+
/// <module name="Class1" type="Class Module">
4245
/// <![CDATA[
43-
/// Class1:
44-
///
4546
/// Public Function Foo() As Class2
4647
/// Attibute Foo.VB_UserMemId = 0
4748
/// Set Foo = New Class2
4849
/// End Function
49-
///
50-
/// Class2:
51-
///
50+
/// ]]>
51+
/// </module>
52+
/// <module name="Class2" type="Class Module">
53+
/// <![CDATA[
5254
/// Public Function Bar() As Long
5355
/// Attibute Bar.VB_UserMemId = 0
5456
/// Foo = 42
5557
/// End Function
56-
///
57-
/// Module:
58-
///
58+
/// ]]>
59+
/// </module>
60+
/// <module name="Module" type="Standard Module">
61+
/// <![CDATA[
5962
/// Public Sub DoSomething(ByVal arg As Class1)
6063
/// Dim bar As Variant
6164
/// bar = arg.Foo().Bar()
6265
/// End Sub
6366
/// ]]>
67+
/// </module>
6468
/// </example>
6569
public sealed class ImplicitRecursiveDefaultMemberAccessInspection : IdentifierReferenceInspectionBase
6670
{

Rubberduck.CodeAnalysis/Inspections/Concrete/ImplicitUnboundDefaultMemberAccessInspection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Rubberduck.Inspections.Concrete
1111
{
1212
/// <summary>
13-
/// Identifies the use indexed default member accesses for which the default member cannot be determined at compile time.
13+
/// Identifies the use of indexed default member accesses for which the default member cannot be determined at compile time.
1414
/// </summary>
1515
/// <why>
1616
/// Default member accesses hide away the actually called member. This is especially misleading if there is no indication in the expression that such a call is made

Rubberduck.CodeAnalysis/Inspections/Concrete/IndexedDefaultMemberAccessInspection.cs

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,24 @@
99
namespace Rubberduck.Inspections.Concrete
1010
{
1111
/// <summary>
12-
/// Identifies the use indexed default member accesses.
12+
/// Identifies the use of indexed default member accesses.
1313
/// </summary>
1414
/// <why>
1515
/// An indexed default member access hides away the actually called member.
1616
/// </why>
1717
/// <example hasResult="true">
1818
/// <![CDATA[
19-
/// Class1:
20-
///
21-
/// Public Function Foo(ByVal arg As Long) As Long
22-
/// Attibute Foo.VB_UserMemId = 0
23-
/// Foo = 42
24-
/// End Function
25-
///
26-
/// Module:
27-
///
28-
/// Public Sub DoSomething(ByVal arg As Class1)
19+
/// Public Sub DoSomething(ByVal coll As Collection)
2920
/// Dim bar As Variant
30-
/// bar = arg(23)
21+
/// bar = coll(23)
3122
/// End Sub
3223
/// ]]>
3324
/// </example>
3425
/// <example hasResult="false">
3526
/// <![CDATA[
36-
/// Class1:
37-
///
38-
/// Public Function Foo(ByVal arg As Long) As Long
39-
/// Attibute Foo.VB_UserMemId = 0
40-
/// Foo = 42
41-
/// End Function
42-
///
43-
/// Module:
44-
///
45-
/// Public Sub DoSomething(ByVal arg As Class1)
27+
/// Public Sub DoSomething(ByVal coll As Collection)
4628
/// Dim bar As Variant
47-
/// bar = arg.Foo(23)
29+
/// bar = coll.Item(23)
4830
/// End Sub
4931
/// ]]>
5032
/// </example>

Rubberduck.CodeAnalysis/Inspections/Concrete/IndexedRecursiveDefaultMemberAccessInspection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Rubberduck.Inspections.Concrete
1010
{
1111
/// <summary>
12-
/// Identifies the use indexed default member accesses that require a recursive default member resolution.
12+
/// Identifies the use of indexed default member accesses that require a recursive default member resolution.
1313
/// </summary>
1414
/// <why>
1515
/// An indexed default member access hides away the actually called member. This is especially problematic if the corresponding parameterized default member is not on the interface of the object itself.

Rubberduck.CodeAnalysis/Inspections/Concrete/IndexedUnboundDefaultMemberAccessInspection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace Rubberduck.Inspections.Concrete
1212
{
1313
/// <summary>
14-
/// Identifies the use indexed default member accesses for which the default member cannot be determined at compile time.
14+
/// Identifies the use of indexed default member accesses for which the default member cannot be determined at compile time.
1515
/// </summary>
1616
/// <why>
1717
/// An indexed default member access hides away the actually called member. This is especially problematic if the default member cannot be determined from the declared type of the object.

0 commit comments

Comments
 (0)