File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Rubberduck.CodeAnalysis/Inspections/Concrete Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 1414namespace Rubberduck . Inspections . Concrete
1515{
1616 /// <summary>
17- /// Identifies redundant Boolean expressions in conditionals .
17+ /// Identifies conditional assignments to mutually exclusive Boolean literal values in conditional branches .
1818 /// </summary>
1919 /// <why>
20- /// A Boolean expression never needs to be compared to a Boolean literal in a conditional expression.
20+ /// The assignment could be made directly to the result of the conditional Boolean expression instead .
2121 /// </why>
2222 /// <example hasResults="true">
2323 /// <![CDATA[
24- /// Public Sub DoSomething(ByVal foo As Boolean)
25- /// If foo = True Then ' foo is known to already be a Boolean value.
26- /// ' ...
24+ /// Public Sub DoSomething(ByVal value As Long)
25+ /// Dim result As Boolean
26+ /// If value > 10 Then
27+ /// result = True
28+ /// Else
29+ /// result = False
2730 /// End If
31+ /// Debug.Print result
2832 /// End Sub
2933 /// ]]>
3034 /// </example>
3135 /// <example hasResults="false">
3236 /// <![CDATA[
33- /// Public Sub DoSomething(ByVal foo As Boolean )
34- /// If foo Then
35- /// ' ...
36- /// End If
37+ /// Public Sub DoSomething(ByVal value As Long )
38+ /// Dim result As Boolean
39+ /// result = value > 10
40+ /// Debug.Print result
3741 /// End Sub
3842 /// ]]>
3943 /// </example>
You can’t perform that action at this time.
0 commit comments